Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #11446 copy/paste error in getDepDownloadURL of PEAR REST 1.0 and 1.3
Submitted: 2007-06-26 16:16 UTC
From: farell Assigned: dufuz
Status: Closed Package: PEAR (version 1.6.1)
PHP Version: 5.2.3 OS:
Roadmaps: 1.6.2    
Subscription  


 [2007-06-26 16:16 UTC] farell (Laurent Laville)
Description: ------------ While I try a solution to retrieve thru a php script the latest version available from packages, I found a possible bug into PEAR REST protocol 1.0 and 1.3 Files : PEAR/REST/10.php, PEAR/REST/13.php Look carefully function getDepDownloadURL function getDepDownloadURL($base, $xsdversion, $dependency, $deppackage, $prefstate = 'stable', $installed = false) { $channel = $dependency['channel']; $package = $dependency['name']; $states = $this->betterStates($prefstate, true); if (!$states) { return PEAR::raiseError('"' . $prefstate . '" is not a valid state'); } $state = $version = null; if (isset($packageinfo['state'])) { $state = $packageinfo['state']; } if (isset($packageinfo['version'])) { $version = $packageinfo['version']; } //... } As there is no function parameter or local variable called $packageinfo, I think, it's an old copy/paste from getDownloadURL function. It should be, i suppose, $dependency rather than $packageinfo

Comments

 [2007-08-17 00:09 UTC] dufuz (Helgi Þormar)
Well like you said, seems to be a copy/paste problem, try the attached patch for me before I commit.
 [2007-08-17 19:49 UTC] dufuz (Helgi Þormar)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.