Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit15982d4

Browse files
committed
Normalize ./ path segments
1 parent3a29c1d commit15982d4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ public function makePathRelative($endPath, $startPath)
378378
foreach ($pathSegmentsas$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‎

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp