From 0ef9e4ab27cbf6ee5bee63660875d0d5003a8e3e Mon Sep 17 00:00:00 2001 From: Aleksei Miheev Date: Sat, 17 May 2014 20:51:25 +0000 Subject: [PATCH] Fix notices when debug_backtrace returns less than 2 elements --- Sources/Subs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Subs.php b/Sources/Subs.php index 889b787..fc9a8e6 100644 --- a/Sources/Subs.php +++ b/Sources/Subs.php @@ -219,7 +219,7 @@ function db_query($db_string, $file, $line) $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2); $_file=str_replace('/var/www/rock/forum/','',$file); - $timer = pinba_timer_start(array("component" => 'db_query', 'function' => $trace[1]['function'], 'location' => "{$_file}:{$line}")); + $timer = pinba_timer_start(array("component" => 'db_query', 'function' => (isset ($trace[1]) ? $trace[1]['function'] : ''), 'location' => "{$_file}:{$line}")); // One more query.... $db_count = !isset($db_count) ? 1 : $db_count + 1;