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

Bug #902 PEAR QA: improvement for get_class()-usage
Submitted: 2004-02-26 14:26 UTC
From: pear-qa at lists dot php dot net Assigned: dallen
Status: Closed Package: XML_CSSML
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2004-02-26 14:26 UTC] pear-qa at lists dot php dot net
Description: ------------ ## from the PEAR QA team ## ## quality-assurance related ## Please note that if you don't react to this issue within 4 weeks the PEAR QA-team will take care of it automatically. This is not "rude" but necessary for QA. If this is a "false positive" and your package is not affected please apologize. This package uses get_class()-calls without care for case-sensitivity of the returned classnames. In PHP 4.x the default for getclass() was that lowercase classnames were returned. However, due to extended DOM functionality, PHP 5.x returns classnames with correct upper-and-lowercase. If you intend to run your package under both PHP4 and PHP5 please consider using case-independent comparisons or apply case-fixes. Found in: FILE: '/cvs/php/pear/XML_CSSML/CSSML.php' : /cvs/php/pear/XML_CSSML/CSSML.php(50): return (bool) (is_object($in_data) && (get_class($in_data) == strtolower($in_detect) || is_subclass_of($in_data, strtolower($in_detect)))); /cvs/php/pear/XML_CSSML/CSSML.php(307): $vars = get_class_vars('XML_CSSML'); ---------------------------------------- FILE: '/cvs/php/pear/XML_CSSML/CSSML/libxslt.php' : /cvs/php/pear/XML_CSSML/CSSML/libxslt.php(100): if ($in_type == 'object' && get_class($in_CSSML) == 'DomDocument') { /cvs/php/pear/XML_CSSML/CSSML/libxslt.php(116): if (get_class($this->CSSMLDoc) != 'DomDocument') { Reproduce code: --------------- Affected are constructs like: if (get_class($foo) == 'foo') { ... } Possible solutions for correct class-checks: strtolower(get_class($foo)) == 'foo' is_a($foo, 'foo') !strcasecmp(get_class($foo), 'foo')

Comments

 [2005-09-30 08:44 UTC] dufuz
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.