Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 15982d4

Browse filesBrowse files
committed
Normalize ./ path segments
1 parent 3a29c1d commit 15982d4
Copy full SHA for 15982d4

File tree

2 files changed

+4
-1
lines changed
Filter options

2 files changed

+4
-1
lines changed

‎src/Symfony/Component/Filesystem/Filesystem.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Filesystem.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ public function makePathRelative($endPath, $startPath)
378378
foreach ($pathSegments as $segment) {
379379
if ('..' === $segment) {
380380
array_pop($result);
381-
} else {
381+
} elseif ('.' !== $segment) {
382382
$result[] = $segment;
383383
}
384384
}

‎src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,9 @@ public function providePathsForMakePathRelative()
881881
array('C:/../../aa/../bb/cc', 'C:/aa/dd/..', '../bb/cc/'),
882882
array('aa/bb', 'aa/cc', '../bb/'),
883883
array('aa/cc', 'bb/cc', '../../aa/cc/'),
884+
array('aa/bb', 'aa/./cc', '../bb/'),
885+
array('aa/./bb', 'aa/cc', '../bb/'),
886+
array('aa/./bb', 'aa/./cc', '../bb/'),
884887
);
885888

886889
if ('\\' === DIRECTORY_SEPARATOR) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.