Mantis - Quercus
Viewing Issue Advanced Details
2023 minor always 09-24-07 01:00 09-24-07 17:04
krogh  
nam  
normal  
closed 3.1.2  
fixed  
none    
none 3.1.3  
0002023: 0 isn't handled as a BooleanValue
Hello,

trying to install joomla 1.0.13 on glassfish / quercus, I had some problem with xml handling (domit lib used by joomla).

It appears xmlOptionCaseFolding didn't reflect the corresponding option when set using 0 (0 & 1 should be hanlded as boolean depending of the context).

Buggy php code:
 xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);

Working version:
 xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);


/quercus/src/com/caucho/quercus/lib/xml/Xml.java
      case XmlModule.XML_OPTION_CASE_FOLDING:
        if (value instanceof BooleanValue) {
          _xmlOptionCaseFolding = value.toBoolean();
          return true;
        } else {
          return false;
        }

I saw similar code many times to handle booleans, mabye it should be replaced by an helper that also check number values (0 => false, any other value => true).

Notes
(0002308)
nam   
09-24-07 17:04   
php/1h0b