PEAR_REST 1.0 and 1.3 possible bug (minor)

From: Date: Tue, 26 Jun 2007 16:03:51 +0000
Subject: PEAR_REST 1.0 and 1.3 possible bug (minor)
Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-4366@lists.php.net to get a copy of this message
Hi, While I try a solution to retrieve latest version of packages thru php script, I found a possible bug into PEAR/REST/10.php and PEAR/REST13.php Look inside 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 a simple copy/paste (from getDownloadURL function) without replace. I suppose here it should be
    if (isset($dependency['state'])) {
        $state = $dependency['state'];
    }
    if (isset($dependency['version'])) {
        $version = $dependency['version'];
    }
rather than
    if (isset($packageinfo['state'])) {
        $state = $packageinfo['state'];
    }
    if (isset($packageinfo['version'])) {
        $version = $packageinfo['version'];
    }
A confirmation may be cool before open a new bug report. regards Laurent

« previous php.pear.qa (#4366) next »