diff --git a/core/log.class.inc.php b/core/log.class.inc.php index 3a98b4f77..07d88fbe4 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -1110,7 +1110,12 @@ class DeprecatedCallsLog extends LogAPI } $aStack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 4); - $iStackDeprecatedMethodLevel = 2; // level 0 = current method, level 1 = @trigger_error, level 2 = method containing the `trigger_error` call + $iStackDeprecatedMethodLevel = 2; // level 0 = current method, level 1 = @trigger_error, level 2 = method containing the `trigger_error` call (can be either 'trigger_deprecation' or the faulty method), level 3 = In some cases, method containing the 'trigger_deprecation' call + // In case current level is actually a 'trigger_deprecation' call, try to go one level further to get the real deprecated method + if (array_key_exists($iStackDeprecatedMethodLevel, $aStack) && ($aStack[$iStackDeprecatedMethodLevel]['function'] === 'trigger_deprecation') && array_key_exists($iStackDeprecatedMethodLevel + 1, $aStack)) { + $iStackDeprecatedMethodLevel++; + } + $sDeprecatedObject = $aStack[$iStackDeprecatedMethodLevel]['class']; $sDeprecatedMethod = $aStack[$iStackDeprecatedMethodLevel]['function']; if (($sDeprecatedObject === __CLASS__) && ($sDeprecatedMethod === 'Log')) {