Skip to content

Commit

Permalink
Fix normalizeFilename when multiple matches (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Aug 24, 2023
1 parent 51d4a30 commit 8b7b894
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/DataCollector/QueryCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,14 @@ protected function normalizeFilename($path)
if (file_exists($path)) {
$path = realpath($path);
}
return str_replace(base_path(), '', $path);

$basepath = base_path();

if (! str_starts_with($path, $basepath)) {
return $path;
}

return substr($path, strlen($basepath));
}

/**
Expand Down

0 comments on commit 8b7b894

Please sign in to comment.