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

Bug #19141 PEAR::isError() fails with PHP 5.3.7+
Submitted: 2011-12-17 05:10 UTC
From: ftzdomino Assigned: doconnor
Status: Closed Package: PEAR (version 1.9.4)
PHP Version: 5.3.8 OS: debian stable
Roadmaps: 1.9.5    
Subscription  


 [2011-12-17 05:10 UTC] ftzdomino (Jon Snell)
Description: ------------ PEAR::isError fails to check the type of $data before calling is_a() on it. In PHP 5.3.7 and newer, if the first argument of is_a() is a string, PHP will attempt to load it as a class. In PHP 5.3.6 and lower, it will cause warnings in strict mode. Test script: --------------- include("/usr/share/php/PEAR.php"); function __autoload($name) { include($name); } PEAR::isError("a string, not a class"); Expected result: ---------------- PEAR::isError() would simply return false when supplied a string Actual result: -------------- Warning: include(a string, not a class): failed to open stream: No such file or directory in Command line code on line 1 Warning: include(): Failed opening 'a string, not a class' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Command line code on line 1

Comments

 [2011-12-17 05:12 UTC] ftzdomino (Jon Snell)
For some reason I'm not allowed to upload a patch, so I did it in github via a pull request: https://github.com/pear/pear-core/pull/3
 [2011-12-17 17:46 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in SVN. 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. Thanks for the patch
 [2014-05-29 12:27 UTC] cweiske (Christian Weiske)
-Roadmap Versions: +Roadmap Versions: 1.9.5