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 a1cc266 commit 971243eCopy full SHA for 971243e
src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
@@ -78,14 +78,16 @@ public static function setFile($file)
78
*/
79
public static function pathToLogFile($file)
80
{
81
- if (!starts_with('/', $file)) {
82
- $logsPath = storage_path('logs');
+ $logsPath = storage_path('logs');
83
84
- $file = $logsPath . '/' . $file;
+ if (app('files')->exists($file)) { // try the absolute path
+ return $file;
85
}
86
+
87
+ $file = $logsPath . '/' . $file;
88
89
// check if requested file is really in the logs directory
- if (dirname(realpath($file)) !== $logsPath) {
90
+ if (dirname($file) !== $logsPath) {
91
throw new \Exception('No such log file');
92
93
0 commit comments