Explorar o código

[ClassLoader] no need to call str_replace on Windows

Tobias Schultze %!s(int64=9) %!d(string=hai) anos
pai
achega
a76ce9b25a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Composer/Autoload/ClassLoader.php

+ 1 - 1
src/Composer/Autoload/ClassLoader.php

@@ -344,7 +344,7 @@ class ClassLoader
     private function findFileWithExtension($class, $ext)
     {
         // PSR-4 lookup
-        $logicalPathPsr4 = str_replace('\\', DIRECTORY_SEPARATOR, $class) . $ext;
+        $logicalPathPsr4 = ('\\' !== DIRECTORY_SEPARATOR ? str_replace('\\', DIRECTORY_SEPARATOR, $class) : $class) . $ext;
 
         $first = $class[0];
         if (isset($this->prefixLengthsPsr4[$first])) {