summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc6
1 files changed, 6 insertions, 0 deletions
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];