diff --git a/library/Zend/Loader/ClassMapAutoloader.php b/library/Zend/Loader/ClassMapAutoloader.php index 36206e50bd9..58b6378dbe2 100644 --- a/library/Zend/Loader/ClassMapAutoloader.php +++ b/library/Zend/Loader/ClassMapAutoloader.php @@ -197,11 +197,12 @@ protected function loadMapFromFile($location) */ public static function realPharPath($path) { - if (strpos($path, 'phar:///') !== 0) { + if (!preg_match('|^phar:(/{2,3})|',$path, $match)) { return; } - $parts = explode('/', str_replace(array('/', '\\'), '/', substr($path, 8))); + $prefixLength = 5 + strlen($match[1]); + $parts = explode('/', str_replace(array('/', '\\'), '/', substr($path, $prefixLength))); $parts = array_values(array_filter($parts, function ($p) { return ($p !== '' && $p !== '.'); })); @@ -213,7 +214,7 @@ public static function realPharPath($path) } }); - if (file_exists($realPath = 'phar:///' . implode('/', $parts))) { + if (file_exists($realPath = str_pad('phar:', $prefixLength, '/') . implode('/', $parts))) { return $realPath; } }