From 19748f7c5b083f570b12d049226caa4ea0d4f25b Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 13 Oct 2015 14:13:29 +0200 Subject: [PATCH] Result: improved normalization of int --- dibi/libs/DibiResult.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dibi/libs/DibiResult.php b/dibi/libs/DibiResult.php index ead57984..ad27fab1 100644 --- a/dibi/libs/DibiResult.php +++ b/dibi/libs/DibiResult.php @@ -492,7 +492,9 @@ class DibiResult extends DibiObject implements IDataSource if ($value === FALSE || $type === dibi::TEXT) { } elseif ($type === dibi::INTEGER) { - $row[$key] = is_float($tmp = $value * 1) ? $value : $tmp; + $row[$key] = is_float($tmp = $value * 1) + ? (is_string($value) ? $value : (int) $value) + : $tmp; } elseif ($type === dibi::FLOAT) { $value = ltrim($value, '0');