Merge pull request #4069 from dokuwiki/debugbacktrace

Fix Undefined array key "file" and "line"
This commit is contained in:
Andreas Gohr 2024-01-26 12:52:08 +01:00 committed by GitHub
commit 78b8232bb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 3 deletions

View File

@ -531,9 +531,16 @@ function dbg_backtrace()
$calls = [];
$depth = count($backtrace) - 1;
foreach ($backtrace as $i => $call) {
$location = $call['file'] . ':' . $call['line'];
$function = (isset($call['class'])) ?
$call['class'] . $call['type'] . $call['function'] : $call['function'];
if (isset($call['file'])) {
$location = $call['file'] . ':' . ($call['line'] ?? '0');
} else {
$location = '[anonymous]';
}
if (isset($call['class'])) {
$function = $call['class'] . $call['type'] . $call['function'];
} else {
$function = $call['function'];
}
$params = [];
if (isset($call['args'])) {