mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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
This commit is contained in:
parent
f88cc56cfe
commit
f710ae7fbe
1 changed files with 5 additions and 2 deletions
|
@ -204,7 +204,7 @@ class DboMysqli extends DboMysqlBase {
|
|||
return 'NULL';
|
||||
}
|
||||
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
|
||||
return "''";
|
||||
return "''";
|
||||
}
|
||||
if (empty($column)) {
|
||||
$column = $this->introspectType($data);
|
||||
|
@ -212,11 +212,14 @@ class DboMysqli extends DboMysqlBase {
|
|||
|
||||
switch ($column) {
|
||||
case 'boolean':
|
||||
$data = $this->boolean((bool)$data);
|
||||
return $this->boolean((bool)$data);
|
||||
break;
|
||||
case 'integer' :
|
||||
case 'float' :
|
||||
case null :
|
||||
if ($data === '') {
|
||||
return 'NULL';
|
||||
}
|
||||
if ((is_int($data) || is_float($data) || $data === '0') || (
|
||||
is_numeric($data) && strpos($data, ',') === false &&
|
||||
$data[0] != '0' && strpos($data, 'e') === false)) {
|
||||
|
|
Loading…
Reference in a new issue