Prechádzať zdrojové kódy

Improve regex in \Composer\Repository\ComposerRepository::fetchFile() by removing unnecessary greedy operator

Ayesh Karunaratne 4 rokov pred
rodič
commit
d4c8478df5

+ 1 - 1
src/Composer/Repository/ComposerRepository.php

@@ -997,7 +997,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
         }
 
         // url-encode $ signs in URLs as bad proxies choke on them
-        if (($pos = strpos($filename, '$')) && preg_match('{^https?://.*}i', $filename)) {
+        if (($pos = strpos($filename, '$')) && preg_match('{^https?://}i', $filename)) {
             $filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos + 1);
         }