[Debug] Fix debug mode reports indexing error
Error log reports "PHP Notice: Undefined offset: 2 in /rss-bridge/ lib/Debug.php on line 112" if the array returned by debug_backtrace does not contain 3 items. This commit fixes the issue by always using the last element in the backtrace "end($backtrace)".
This commit is contained in:
parent
3806895059
commit
254fe9212a
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ class Debug {
|
|||
}
|
||||
|
||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
||||
$calling = $backtrace[2];
|
||||
$calling = end($backtrace);
|
||||
$message = $calling['file'] . ':'
|
||||
. $calling['line'] . ' class '
|
||||
. (isset($calling['class']) ? $calling['class'] : '<no-class>') . '->'
|
||||
|
|
Loading…
Reference in a new issue