summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2012-01-23 12:44:02 (GMT)
committer Gábor Hojtsy2012-01-23 12:44:02 (GMT)
commit4d9234f4b1ade67170cb8459b76710f05ce48293 (patch)
tree03bd87c12208d8bbc92495238fd5dec247f71ab5
parent8d060bc4720f308f580b5610a805a4099fbaa598 (diff)
Issue #1174496 by Eric_A, grendzy, greg.1.anderson, c31ck: drupal_error_handler() should not assume filter_xss() is available. It might be called before that is loaded. Also fixes Drush compatibility.
-rw-r--r--includes/common.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 25a0637..e7515f5 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -652,7 +652,9 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) {
}
}
- $entry = check_plain($types[$errno]) .': '. filter_xss($message) .' in '. check_plain($filename) .' on line '. check_plain($line) .'.';
+ // Try to use filter_xss(). If it's too early in the bootstrap process for
+ // filter_xss() to be loaded, use check_plain() instead.
+ $entry = check_plain($types[$errno]) .': '. (function_exists('filter_xss') ? filter_xss($message) : check_plain($message)) .' in '. check_plain($filename) .' on line '. check_plain($line) .'.';
// Force display of error messages in update.php.
if (variable_get('error_level', 1) == 1 || strstr($_SERVER['SCRIPT_NAME'], 'update.php')) {