Skip to content

Commit 9da7c50

Browse files
author
Anton Bakai
committed
removed checks for absolute paths
1 parent 8eb97f5 commit 9da7c50

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,11 @@ public function makePathRelative($endPath, $startPath)
480480
$startPathArr = explode('/', trim($startPath, '/'));
481481
$endPathArr = explode('/', trim($endPath, '/'));
482482

483-
$normalizePathArray = function ($pathSegments, $absolute) {
483+
$normalizePathArray = function ($pathSegments) {
484484
$result = array();
485485

486486
foreach ($pathSegments as $segment) {
487-
if ('..' === $segment && ($absolute || count($result))) {
487+
if ('..' === $segment) {
488488
array_pop($result);
489489
} elseif ('.' !== $segment) {
490490
$result[] = $segment;
@@ -494,8 +494,8 @@ public function makePathRelative($endPath, $startPath)
494494
return $result;
495495
};
496496

497-
$startPathArr = $normalizePathArray($startPathArr, static::isAbsolutePath($startPath));
498-
$endPathArr = $normalizePathArray($endPathArr, static::isAbsolutePath($endPath));
497+
$startPathArr = $normalizePathArray($startPathArr);
498+
$endPathArr = $normalizePathArray($endPathArr);
499499

500500
// Find for which directory the common path stops
501501
$index = 0;

0 commit comments

Comments
 (0)