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

Bug #10073 Zero (0) bug with empty() in _localeSafeImplode()
Submitted: 2007-02-12 17:25 UTC
From: lukas dot ruetz at gmx dot at Assigned: quipo
Status: Closed Package: MDB_QueryTool (version CVS)
PHP Version: 5.2.0 OS: SuSE Linux 10.2
Roadmaps: (Not assigned)    
Subscription  


 [2007-02-12 17:25 UTC] lukas dot ruetz at gmx dot at (Lukas Ruetz)
Description: ------------ If the first field is a numeric-field and the value 0 (number zero), then empty() returns true twice what causes no comma between the first and the second value in _localeSafeImplode() Test script: --------------- --- old/Query.php 2007-01-29 13:33:15.000000000 +0100 +++ new/Query.php 2007-02-12 18:20:26.000000000 +0100 @@ -629,7 +629,7 @@ { $str = ''; foreach ($array as $value) { - if (!empty($str)) { + if ($str !== '') { $str .= $glue; } $str .= is_double($value) ? $this->_floatToStringNoLocale($value) : $value; Expected result: ---------------- 0,'something' Actual result: -------------- 0'something'

Comments

 [2007-02-12 20:38 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!