Skip to content

Commit 1a11c77

Browse files
authored
Check that file is readable (#243)
1 parent 27392d2 commit 1a11c77

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ public function all()
155155
return null;
156156
}
157157

158+
if (!is_readable($this->file)) {
159+
return [[
160+
'context' => '',
161+
'level' => '',
162+
'date' => null,
163+
'text' => 'Log file "' . $this->file . '" not readable',
164+
'stack' => '',
165+
]];
166+
}
167+
158168
$file = app('files')->get($this->file);
159169

160170
preg_match_all($this->pattern->getPattern('logs'), $file, $headings);

0 commit comments

Comments
 (0)