Skip to content

Commit

Permalink
Update LaravelLogViewer.php
Browse files Browse the repository at this point in the history
  • Loading branch information
rap2hpoutre committed May 28, 2017
1 parent a1cc266 commit 971243e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@ public static function setFile($file)
*/
public static function pathToLogFile($file)
{
if (!starts_with('/', $file)) {
$logsPath = storage_path('logs');
$logsPath = storage_path('logs');

$file = $logsPath . '/' . $file;
if (app('files')->exists($file)) { // try the absolute path
return $file;
}

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

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

Expand Down

0 comments on commit 971243e

Please sign in to comment.