소스 검색

Update only github dist URLs, refs #3985

Jordi Boggiano 10 년 전
부모
커밋
d426246b80
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/Composer/Installer.php

+ 5 - 1
src/Composer/Installer.php

@@ -968,7 +968,11 @@ class Installer
 
                 // update the dist and source URLs
                 $package->setSourceUrl($newPackage->getSourceUrl());
-                $package->setDistUrl($newPackage->getDistUrl());
+                // only update dist url for github dists as they use a combination of dist url + dist reference to install
+                // but for other urls this is ambiguous and could result in bad outcomes
+                if (preg_match('{^https?://(api\.)?github\.com/}', $newPackage->getDistUrl())) {
+                    $package->setDistUrl($newPackage->getDistUrl());
+                }
             }
         }
     }