Commit 99fa84cb authored by webchick's avatar webchick

Issue #1158322 follow-up by chx: Fixed htmlspecialchars() expects parameter 1...

Issue #1158322 follow-up by chx: Fixed htmlspecialchars() expects parameter 1 to be string, array given errors in exception backtraces.
parent 17766341
...@@ -1673,7 +1673,7 @@ function request_uri($omit_query_string = FALSE) { ...@@ -1673,7 +1673,7 @@ function request_uri($omit_query_string = FALSE) {
* A link to associate with the message. * A link to associate with the message.
* *
* @see watchdog() * @see watchdog()
* @see drupal_decode_exception() * @see _drupal_decode_exception()
*/ */
function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = WATCHDOG_ERROR, $link = NULL) { function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = WATCHDOG_ERROR, $link = NULL) {
......
...@@ -613,6 +613,7 @@ function update_do_one($module, $number, $dependency_map, &$context) { ...@@ -613,6 +613,7 @@ function update_do_one($module, $number, $dependency_map, &$context) {
require_once DRUPAL_ROOT . '/core/includes/errors.inc'; require_once DRUPAL_ROOT . '/core/includes/errors.inc';
$variables = _drupal_decode_exception($e); $variables = _drupal_decode_exception($e);
unset($variables['backtrace']);
// The exception message is run through check_plain() by _drupal_decode_exception(). // The exception message is run through check_plain() by _drupal_decode_exception().
$ret['#abort'] = array('success' => FALSE, 'query' => t('%type: !message in %function (line %line of %file).', $variables)); $ret['#abort'] = array('success' => FALSE, 'query' => t('%type: !message in %function (line %line of %file).', $variables));
} }
......
...@@ -1073,7 +1073,9 @@ protected function exceptionHandler($exception) { ...@@ -1073,7 +1073,9 @@ protected function exceptionHandler($exception) {
'file' => $exception->getFile(), 'file' => $exception->getFile(),
)); ));
// The exception message is run through check_plain() by _drupal_decode_exception(). // The exception message is run through check_plain() by _drupal_decode_exception().
$message = format_string('%type: !message in %function (line %line of %file). <pre class="backtrace">!backtrace</pre>', _drupal_decode_exception($exception) + array( $decoded_exception = _drupal_decode_exception($exception);
unset($decoded_exception['backtrace']);
$message = format_string('%type: !message in %function (line %line of %file). <pre class="backtrace">!backtrace</pre>', $decoded_exception + array(
'!backtrace' => format_backtrace($verbose_backtrace), '!backtrace' => format_backtrace($verbose_backtrace),
)); ));
$this->error($message, 'Uncaught exception', _drupal_get_last_caller($backtrace)); $this->error($message, 'Uncaught exception', _drupal_get_last_caller($backtrace));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment