1
0
Fork 0

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

pull/275/head
Pádraic Brady 2012-02-02 19:57:37 +00:00
parent 15d78e6ad1
commit 3f7e7dff33
1 changed files with 3 additions and 0 deletions

View File

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