summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-11 03:49:45 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-11 03:49:45 +0000
commit12fb65aad2567dc9a0d679c9fdec05f2fcfcd5af (patch)
tree25b66182aa0578b229a831ab0094809f7848a89b /includes/common.inc
parent29adf425b5428347fa89f6d0896b47f5a83dcd23 (diff)
downloadbrdo-12fb65aad2567dc9a0d679c9fdec05f2fcfcd5af.tar.gz
brdo-12fb65aad2567dc9a0d679c9fdec05f2fcfcd5af.tar.bz2
#705242 by moshe weitzman: Fixed _drupal_log_error() messy for CLI requests.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 39796bbd4..5285e7311 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1183,6 +1183,13 @@ function _drupal_log_error($error, $fatal = FALSE) {
drupal_add_http_header('500 Service unavailable (with message)');
}
+ if (drupal_is_cli()) {
+ if ($fatal) {
+ // When called from CLI, simply output a plain text message.
+ print html_entity_decode(strip_tags(t('%type: %message in %function (line %line of %file).', $error))). "\n";
+ exit;
+ }
+ }
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
if ($fatal) {
// When called from JavaScript, simply output the error message.