diff options
author | David Rothstein <drothstein@gmail.com> | 2012-09-15 16:04:59 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2012-09-15 16:04:59 -0400 |
commit | 02cf68de3308d7aa0aa4dc13a573a31f0ee7b34e (patch) | |
tree | f5c996dac787ad07f7bdb0e119f3a7407f941281 /includes/database/log.inc | |
parent | c987bbd4796a89552bc2576f6f0cc3fb96bcf702 (diff) | |
download | brdo-02cf68de3308d7aa0aa4dc13a573a31f0ee7b34e.tar.gz brdo-02cf68de3308d7aa0aa4dc13a573a31f0ee7b34e.tar.bz2 |
Issue #1739808 by Berdir, salvis | GrzegorzNowak: Fixed Notice: Undefined index: file in DatabaseLog->findCaller().
Diffstat (limited to 'includes/database/log.inc')
-rw-r--r-- | includes/database/log.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/database/log.inc b/includes/database/log.inc index ec27ef8e6..27eae62cd 100644 --- a/includes/database/log.inc +++ b/includes/database/log.inc @@ -128,9 +128,10 @@ class DatabaseLog { * Determine the routine that called this query. * * We define "the routine that called this query" as the first entry in - * the call stack that is not inside includes/database. That makes the - * climbing logic very simple, and handles the variable stack depth caused - * by the query builders. + * the call stack that is not inside includes/database and does have a file + * (which excludes call_user_func_array(), anonymous functions and similar). + * That makes the climbing logic very simple, and handles the variable stack + * depth caused by the query builders. * * @link http://www.php.net/debug_backtrace * @return @@ -144,7 +145,8 @@ class DatabaseLog { $stack = debug_backtrace(); $stack_count = count($stack); for ($i = 0; $i < $stack_count; ++$i) { - if (strpos($stack[$i]['file'], 'includes' . DIRECTORY_SEPARATOR . 'database') === FALSE) { + if (!empty($stack[$i]['file']) && strpos($stack[$i]['file'], 'includes' . DIRECTORY_SEPARATOR . 'database') === FALSE) { + $stack[$i] += array('args' => array()); return array( 'file' => $stack[$i]['file'], 'line' => $stack[$i]['line'], |