Skip to content

Commit 62974cc

Browse files
Fix: make sure that 'file'/'line' are not empty
There may be no guarantee that `$caller[...]` is actually set, or that either `file` or `line` are not empty.
1 parent 39c7696 commit 62974cc

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.gitignore

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
1-
.DS_Store
21
.idea
32
/nbproject/private/
43
.phplint-cache
54
*.swp
5+
6+
# macOS-specific things to exclude
7+
8+
# General
9+
.DS_Store
10+
.AppleDouble
11+
.LSOverride
12+
13+
# Icon must end with two \r
14+
Icon
15+
16+
17+
Icon?
18+
19+
# Thumbnails
20+
._*
21+
22+
# Files that might appear in the root of a volume
23+
.DocumentRevisions-V100
24+
.fseventsd
25+
.Spotlight-V100
26+
.TemporaryItems
27+
.Trashes
28+
.VolumeIcon.icns
29+
.com.apple.timemachine.donotpresent
30+
31+
# Directories potentially created on remote AFP share
32+
.AppleDB
33+
.AppleDesktop
34+
Network Trash Folder
35+
Temporary Items
36+
.apdisk
37+
38+
# Configuration for the Nova editor
39+
.nova

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(!empty($caller['file']) && !empty($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)