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] quipo (Lorenzo Alberton)
fixed in CVS, thanks.