removed checks for absolute paths
This commit is contained in:
parent
8eb97f5c48
commit
9da7c5046a
@ -480,11 +480,11 @@ class Filesystem
|
|||||||
$startPathArr = explode('/', trim($startPath, '/'));
|
$startPathArr = explode('/', trim($startPath, '/'));
|
||||||
$endPathArr = explode('/', trim($endPath, '/'));
|
$endPathArr = explode('/', trim($endPath, '/'));
|
||||||
|
|
||||||
$normalizePathArray = function ($pathSegments, $absolute) {
|
$normalizePathArray = function ($pathSegments) {
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
foreach ($pathSegments as $segment) {
|
foreach ($pathSegments as $segment) {
|
||||||
if ('..' === $segment && ($absolute || count($result))) {
|
if ('..' === $segment) {
|
||||||
array_pop($result);
|
array_pop($result);
|
||||||
} elseif ('.' !== $segment) {
|
} elseif ('.' !== $segment) {
|
||||||
$result[] = $segment;
|
$result[] = $segment;
|
||||||
@ -494,8 +494,8 @@ class Filesystem
|
|||||||
return $result;
|
return $result;
|
||||||
};
|
};
|
||||||
|
|
||||||
$startPathArr = $normalizePathArray($startPathArr, static::isAbsolutePath($startPath));
|
$startPathArr = $normalizePathArray($startPathArr);
|
||||||
$endPathArr = $normalizePathArray($endPathArr, static::isAbsolutePath($endPath));
|
$endPathArr = $normalizePathArray($endPathArr);
|
||||||
|
|
||||||
// Find for which directory the common path stops
|
// Find for which directory the common path stops
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
Reference in New Issue
Block a user