mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[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
@ -109,7 +109,7 @@ class Debug {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
||||||
$calling = $backtrace[2];
|
$calling = end($backtrace);
|
||||||
$message = $calling['file'] . ':'
|
$message = $calling['file'] . ':'
|
||||||
. $calling['line'] . ' class '
|
. $calling['line'] . ' class '
|
||||||
. (isset($calling['class']) ? $calling['class'] : '<no-class>') . '->'
|
. (isset($calling['class']) ? $calling['class'] : '<no-class>') . '->'
|
||||||
|
Loading…
Reference in New Issue
Block a user