diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php index 7470e9f..6e9fb5e 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php @@ -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');