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

Bug #8127 '0' isn't an empty string
Submitted: 2006-07-06 08:56 UTC
From: dan dot b at juno dot co dot uk Assigned: quipo
Status: No Feedback Package: Translation2 (version 2.0.0beta9)
PHP Version: 4.3.9 OS: Linux 2.6.16-1.2108_FC4sm
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 38 - 9 = ?

 
 [2006-07-06 08:56 UTC] dan dot b at juno dot co dot uk (Dan)
Description: ------------ It you set up a string as the number zero (as you may well need to translate numbers to arabic), doing a get for this string brings back nothing. I'm guessing that the dreaded 'empty()' function is being used to test for blank strings, which the number 0 falls foul of, even though it's not an empty string. Test script: --------------- -- XML file -- <translation2> <languages> <lang id="en"> <name> english </name> <meta> Some meta info here </meta> <error_text> not available </error_text> <encoding> iso-8859-1 </encoding> </lang> <pages> <page key="test"> <string key="zero"> <tr lang="en"> 0 </tr> </string> </page> </pages> </translation2> -- code -- $trans =& Translation2::factory('XML', array('filname' => 'test.xml')); print "[" . $trans->get('zero', 'test') . "]"; Expected result: ---------------- Prints: [0] Actual result: -------------- Prints: []

Comments

 [2006-07-06 09:23 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!
 [2006-07-24 08:49 UTC] dan dot b at juno dot co dot uk
Sorry to open this one up again, but I've upgraded to Beta10 and the problem still exists.
 [2006-07-24 18:59 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!