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

Bug #13059 Invalid release type causes Undefined Property notice
Submitted: 2008-02-04 21:37 UTC
From: gwynne Assigned: dufuz
Status: Closed Package: PEAR
PHP Version: 5.2.5 OS: *
Roadmaps: (Not assigned)    
Subscription  


 [2008-02-04 21:37 UTC] gwynne (Gwynne Raskind)
Description: ------------ An invalid release type in a package.xml (such as snaptshot, misspelling intentional) causes an E_NOTICE in PEAR/PackageFile/v2/Validator.php on line 487. Suggested patch: --- /opt/php/lib/php/PEAR/PackageFile/v2/Validator.php-old 2008-02-04 16:34:56.000000000 -0500 +++ /opt/php/lib/php/PEAR/PackageFile/v2/Validator.php 2008-02-04 16:27:35.000000000 -0500 @@ -484,7 +484,7 @@ } if (!in_array($this->_packageInfo['stability']['release'], array('snapshot', 'devel', 'alpha', 'beta', 'stable'))) { - $this->_invalidState('release', $this->_packageinfo['stability']['release']); + $this->_invalidState('release', $this->_packageInfo['stability']['release']); } if (!in_array($this->_packageInfo['stability']['api'], array('devel', 'alpha', 'beta', 'stable'))) { Test script: --------------- # Edit a package's package.xml to have an invalid release type $ pear install --force package.xml-edited Expected result: ---------------- parsePackageName(): invalid package name "package.xml" in "package.xml" Stability type <release> is not a valid stability (snaptshot), must be one of stable, beta, alpha, devel, snapshot Parsing of package.xml from file "package.xml" failed Cannot initialize 'package.xml', invalid or missing package file Package "package.xml" is not valid install failed Actual result: -------------- Notice: Undefined property: PEAR_PackageFile_v2_Validator::$_packageinfo in PEAR/PackageFile/v2/Validator.php on line 487 parsePackageName(): invalid package name "package.xml" in "package.xml" Stability type <release> is not a valid stability (), must be one of stable, beta, alpha, devel, snapshot Parsing of package.xml from file "package.xml" failed Cannot initialize 'package.xml', invalid or missing package file Package "package.xml" is not valid install failed

Comments

 [2008-03-22 01:34 UTC] dufuz (Helgi Þormar Þorbjörnsson)
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.
 [2008-03-22 08:32 UTC] wiesemann (Mark Wiesemann)
(The package selection change wasn't intended, was it?)