Skip to content

Commit f710ae7

Browse files
author
DarkAngelBGE
committed
Minor refactorings + fix for dbo mysqli related to previous commit
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8261 3807eeeb-6ff5-0310-8944-8be069107fe0
1 parent f88cc56 commit f710ae7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cake/libs/model/datasources/dbo/dbo_mysqli.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,22 @@ function value($data, $column = null, $safe = false) {
204204
return 'NULL';
205205
}
206206
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
207-
return "''";
207+
return "''";
208208
}
209209
if (empty($column)) {
210210
$column = $this->introspectType($data);
211211
}
212212

213213
switch ($column) {
214214
case 'boolean':
215-
$data = $this->boolean((bool)$data);
215+
return $this->boolean((bool)$data);
216216
break;
217217
case 'integer' :
218218
case 'float' :
219219
case null :
220+
if ($data === '') {
221+
return 'NULL';
222+
}
220223
if ((is_int($data) || is_float($data) || $data === '0') || (
221224
is_numeric($data) && strpos($data, ',') === false &&
222225
$data[0] != '0' && strpos($data, 'e') === false)) {

0 commit comments

Comments
 (0)