8000 Bug fix for paths that start with the same string · weaverryan/symfony@51b9246 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51b9246

Browse files
weaverryannicolas-grekas
authored andcommitted
Bug fix for paths that start with the same string
1 parent 3d6e0bd commit 51b9246

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/Symfony/Component/AssetMapper/AssetMapperRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function findLogicalPath(string $filesystemPath): ?string
7676
}
7777

7878
foreach ($this->getDirectories() as $path => $namespace) {
79-
if (!str_starts_with($filesystemPath, $path)) {
79+
if (!str_starts_with($filesystemPath, $path.\DIRECTORY_SEPARATOR)) {
8080
continue;
8181
}
8282

src/Symfony/Component/AssetMapper/Tests/AssetMapperRepositoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function testFindWithNamespaces()
7070
public function testFindLogicalPath()
7171
{
7272
$repository = new AssetMapperRepository([
73+
'dir' => '',
7374
'dir1' => 'some_namespace',
7475
'dir2' => '',
7576
], __DIR__.'/fixtures');
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('file9.js');

0 commit comments

Comments
 (0)
0