Skip to content

Commit d4429a7

Browse files
Marius BurkardGwynethLlewelyn
authored andcommitted
Good point; I'd even use !empty($caller['file']) && !empty($caller['line']) to save a few cycles in the (improbable) case where both _may_ be set, but empty (thus making the whole exercise pointless...).
1 parent 39c7696 commit d4429a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/lib/app.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ function log($msg, $priority = 0, $dblog = true) {
251251
$priority_txt = 'DEBUG';
252252
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); // we don't need _all_ data, so we save some processing time here (gwyneth 20220315)
253253
$caller = array_shift($bt);
254-
$file_line_caller = '[' . strtr(basename($caller['file'], '.php'), '_', ' ') . ':' . $caller['line'] . '] ';
254+
if(isset($caller['file']) && isset($caller['line'])) {
255+
$file_line_caller = '[' . strtr(basename($caller['file'], '.php'), '_', ' ') . ':' . $caller['line'] . '] ';
256+
}
255257
break;
256258
case 1:
257259
$priority_txt = 'WARNING';

0 commit comments

Comments
 (0)