Skip to content

Commit d9bc892

Browse files
authored
[1.x] Fix file path in SlowQueries.php AND Exceptions.php (#104)
* Fix file path in SlowQueries.php * Fix base path separator in formatLocation method
1 parent 4318f01 commit d9bc892

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Recorders/Exceptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,6 @@ protected function isInternalFile(string $file): bool
136136
*/
137137
protected function formatLocation(string $file, ?int $line): string
138138
{
139-
return Str::replaceFirst(base_path('/'), '', $file).(is_int($line) ? (':'.$line) : '');
139+
return Str::replaceFirst(base_path(DIRECTORY_SEPARATOR), '', $file).(is_int($line) ? (':'.$line) : '');
140140
}
141141
}

src/Recorders/SlowQueries.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ protected function resolveLocation(): string
8585
*/
8686
protected function isInternalFile(string $file): bool
8787
{
88-
return Str::startsWith($file, base_path('vendor/laravel/pulse'))
89-
|| Str::startsWith($file, base_path('vendor/laravel/framework'))
88+
return Str::startsWith($file, base_path('vendor'.DIRECTORY_SEPARATOR.'laravel'.DIRECTORY_SEPARATOR.'pulse'))
89+
|| Str::startsWith($file, base_path('vendor'.DIRECTORY_SEPARATOR.'laravel'.DIRECTORY_SEPARATOR.'framework'))
9090
|| $file === base_path('artisan')
9191
|| $file === public_path('index.php');
9292
}
@@ -96,6 +96,6 @@ protected function isInternalFile(string $file): bool
9696
*/
9797
protected function formatLocation(string $file, ?int $line): string
9898
{
99-
return Str::replaceFirst(base_path('/'), '', $file).(is_int($line) ? (':'.$line) : '');
99+
return Str::replaceFirst(base_path(DIRECTORY_SEPARATOR), '', $file).(is_int($line) ? (':'.$line) : '');
100100
}
101101
}

0 commit comments

Comments
 (0)