From 32d1856d40416438c52b8eb0651814a0fd32c0eb Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Mon, 19 Sep 2016 22:03:22 +0100 Subject: [PATCH] FIX Debug::caller() will now handle errors from outside function calls (#6029) --- dev/Debug.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/Debug.php b/dev/Debug.php index 57aef510f..26d7f69ab 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -89,11 +89,12 @@ class Debug { */ public static function caller() { $bt = debug_backtrace(); - $caller = $bt[2]; + $caller = isset($bt[2]) ? $bt[2] : array(); $caller['line'] = $bt[1]['line']; $caller['file'] = $bt[1]['file']; if(!isset($caller['class'])) $caller['class'] = ''; if(!isset($caller['type'])) $caller['type'] = ''; + if(!isset($caller['function'])) $caller['function'] = ''; return $caller; }