Browse Source

Fix a small bug where some PEAR channels' category link href doesn't contain a starting forward slash

Pádraic Brady 13 năm trước cách đây
mục cha
commit
3f7e7dff33
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      src/Composer/Repository/PearRepository.php

+ 3 - 0
src/Composer/Repository/PearRepository.php

@@ -53,6 +53,9 @@ class PearRepository extends ArrayRepository
         foreach ($categories as $category) {
             $categoryLink = $category->getAttribute("xlink:href");
             $categoryLink = str_replace("info.xml", "packages.xml", $categoryLink);
+            if ($categoryLink[0] != '/') {
+                $categoryLink = '/' . $categoryLink;
+            }
             $packagesXML = $this->requestXml($this->url . $categoryLink);
 
             $packages = $packagesXML->getElementsByTagName('p');