diff options
author | Andreas Gohr <andi@splitbrain.org> | 2022-08-14 18:03:55 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2022-08-14 18:03:55 +0200 |
commit | c0ece86a0ac0cfab0856b056fb3ce8e726855542 (patch) | |
tree | 24993c0e9584de41b662a3c41c3ed4fcc9983f52 /inc/Debug/DebugHelper.php | |
parent | 25edeeca14acaa318ea8f0009bd3a8f20921558f (diff) | |
download | dokuwiki-c0ece86a0ac0cfab0856b056fb3ce8e726855542.tar.gz dokuwiki-c0ece86a0ac0cfab0856b056fb3ce8e726855542.zip |
Another fix for #3717
The deprecation mechanism did actually log the wrong file (callee
instead of caller). This was fixed and the message adjusted again.
A guardian for very short backtraces and large offsets was added
Diffstat (limited to 'inc/Debug/DebugHelper.php')
-rw-r--r-- | inc/Debug/DebugHelper.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/Debug/DebugHelper.php b/inc/Debug/DebugHelper.php index a3f7a4de6..fb04c0374 100644 --- a/inc/Debug/DebugHelper.php +++ b/inc/Debug/DebugHelper.php @@ -46,7 +46,7 @@ class DebugHelper $backtrace = debug_backtrace(); for ($i = 0; $i < $callerOffset; $i += 1) { - array_shift($backtrace); + if(count($backtrace) > 1) array_shift($backtrace); } list($self, $call) = $backtrace; @@ -64,8 +64,8 @@ class DebugHelper trim( (!empty($call['class']) ? ($call['class'] . '::') : '') . $call['function'] . '()', ':'), - $self['file'], - $self['line'] + $call['file'], + $call['line'] ); } |