Skip to content

Commit

Permalink
Merge pull request #59 from limonte/fix-absolute-path
Browse files Browse the repository at this point in the history
Fix using log files with absolute path
  • Loading branch information
rap2hpoutre committed May 3, 2016
2 parents a874952 + b9d98e4 commit bef8c31
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 bef8c31

Please sign in to comment.