We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8da15ca commit 4129da0Copy full SHA for 4129da0
src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
@@ -78,16 +78,14 @@ public static function setFile($file)
78
*/
79
public static function pathToLogFile($file)
80
{
81
- $logsPath = storage_path('logs');
+ if (!starts_with('/', $file)) {
82
+ $logsPath = storage_path('logs');
83
- if (app('files')->exists($file)) { // try the absolute path
84
- return $file;
+ $file = $logsPath . '/' . $file;
85
}
86
87
- $file = $logsPath . '/' . $file;
88
-
89
// check if requested file is really in the logs directory
90
- if (dirname($file) !== $logsPath) {
+ if (dirname(realpath($file)) !== $logsPath) {
91
throw new \Exception('No such log file');
92
93
0 commit comments