From 568034d90cb3c3832a47a61bd79cf0e708aa0d4d Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 14 Sep 2008 21:14:21 +0000 Subject: #308399 by Damien Tournoud: Fix SimpleTest error handler to not spaz out and die when PHP errors are encountered. --- includes/common.inc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 3a00beea4..33109f00e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -637,6 +637,12 @@ function drupal_error_handler($errno, $message, $filename, $line, $context) { * An associative array with keys 'file', 'line' and 'function'. */ function _drupal_get_last_caller($backtrace) { + // Errors that occur inside PHP internal functions + // do not generate information about file and line. + while ($backtrace && !isset($backtrace[0]['line'])) { + array_shift($backtrace); + } + // The first trace is the call itself. // It gives us the line and the file of the last call. $call = $backtrace[0]; -- cgit v1.2.3