diff --git a/includes/common.inc b/includes/common.inc index 25a0637e1085f0142d68123e10ef381945fe34ad..e7515f5f80ccdc931158d60d344c87e6af1a5a11 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')) {