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

Bug #3408 XML container : empty data sets badly handled
Submitted: 2005-02-08 17:12 UTC
From: ylf at xung dot org Assigned: quipo
Status: Closed Package: Translation2
PHP Version: 4.3.4 OS: Linux Debian
Roadmaps: (Not assigned)    
Subscription  


 [2005-02-08 17:12 UTC] ylf at xung dot org
Description: ------------ Hi, Here's the symptom, for both the current cvs and 2.0.0beta6 : Warning: array_pop(): The argument should be an array in /var/www/dev/pear_cvs/Translation2/Container/xml.php on line 280 Warning: Invalid argument supplied for foreach() in /var/www/dev/pear_cvs/Translation2/Container/xml.php on line 196 This happens with an empty page, ie : <page name="myPage"> </page> The problem comes from XML_Unserializer which sets $this->_data['pages']['myPage'] to an empty string when it should be an empty array. Similar issues are likely to happen for any of the tags that have an undefined (possibly null) number of sub-tags, as defined in the DTD : <!ELEMENT languages (lang*)> <!ELEMENT pages (page*)> <!ELEMENT page (string*)> <!ELEMENT string (tr*)> I believe the DTD is just fine, and that it is a good thing to allow empty pages, empty strings, etc... So that the developer can produce a draft of all needed strings and pages before the translator fills them in. Here's a fix for the XML container and scripts/t2xmlchk.php, which applies fine against the current cvs version : http://samalyse.com/ln/0011.php Cheers

Comments

 [2005-02-10 08:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!