Home » Database » MDB_QueryTool » Bug #10073
Zero (0) bug with empty() in _localeSafeImplode()
Details
| Submitted | 2007-02-12 17:25 UTC |
|---|---|
| From | lukas dot ruetz at gmx dot at |
| Assigned | quipo |
| Status | Closed |
| Package | MDB_QueryTool |
| PHP Version | 5.2.0 |
| OS | SuSE Linux 10.2 |
| Roadmaps | (Not assigned) |
Comments
[2007-02-12 17:25 UTC] lukas dot ruetz at gmx dot at
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'