Skip to content

Commit

Permalink
Check that file is readable (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
hulkur authored Oct 1, 2020
1 parent 27392d2 commit 1a11c77
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ public function all()
return null;
}

if (!is_readable($this->file)) {
return [[
'context' => '',
'level' => '',
'date' => null,
'text' => 'Log file "' . $this->file . '" not readable',
'stack' => '',
]];
}

$file = app('files')->get($this->file);

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

0 comments on commit 1a11c77

Please sign in to comment.