diff --git a/Classes/Utility/PathUtility.php b/Classes/Utility/PathUtility.php index 185ef7d..fc970aa 100644 --- a/Classes/Utility/PathUtility.php +++ b/Classes/Utility/PathUtility.php @@ -30,16 +30,13 @@ public static function path2array($path, $delimiter = '/') public static function compare($pathOne, $pathTwo, $delimiter = '/') { $pathOne = self::path2array($pathOne); - $pathTwo = self::path2array($pathTwo); for ($distance = 0; $distance < count($pathOne); $distance++) { - for ($p2index = 0; $p2index < count($pathTwo); $p2index++) { - if ($pathOne[$distance] === $pathTwo[$p2index]) { - return $distance + $p2index; - } + if ($pathOne[$distance] === $pathTwo) { + return $distance; } } - return -1; + return null; } }