From b9d98e4cc00fed2e3c66e20067f4ca36cb4f7956 Mon Sep 17 00:00:00 2001 From: Limon Monte Date: Tue, 3 May 2016 21:51:38 +0200 Subject: [PATCH] Fix using log files with absolute path --- src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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');