removed checks for absolute paths

This commit is contained in:
Anton Bakai 2017-11-19 00:56:10 +02:00
parent 8eb97f5c48
commit 9da7c5046a

View File

@ -480,11 +480,11 @@ class Filesystem
$startPathArr = explode('/', trim($startPath, '/'));
$endPathArr = explode('/', trim($endPath, '/'));
$normalizePathArray = function ($pathSegments, $absolute) {
$normalizePathArray = function ($pathSegments) {
$result = array();
foreach ($pathSegments as $segment) {
if ('..' === $segment && ($absolute || count($result))) {
if ('..' === $segment) {
array_pop($result);
} elseif ('.' !== $segment) {
$result[] = $segment;
@ -494,8 +494,8 @@ class Filesystem
return $result;
};
$startPathArr = $normalizePathArray($startPathArr, static::isAbsolutePath($startPath));
$endPathArr = $normalizePathArray($endPathArr, static::isAbsolutePath($endPath));
$startPathArr = $normalizePathArray($startPathArr);
$endPathArr = $normalizePathArray($endPathArr);
// Find for which directory the common path stops
$index = 0;