Skip to content

Commit

Permalink
Fix using log files with absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
Limon Monte committed May 3, 2016
1 parent a874952 commit b9d98e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ public static function pathToLogFile($file)
{
$logsPath = storage_path('logs');

if (! File::exists($file)) { // try the absolute path
$file = $logsPath . '/' . $file;
if (File::exists($file)) { // try the absolute path
return $file;
}

$file = $logsPath . '/' . $file;

// check if requested file is really in the logs directory
if (dirname($file) !== $logsPath) {
throw new \Exception('No such log file');
Expand Down

0 comments on commit b9d98e4

Please sign in to comment.