Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit f710ae7fbe7837d4401cca1a95395ae7c729929d 1 parent f88cc56
@tim-kos tim-kos authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 cake/libs/model/datasources/dbo/dbo_mysqli.php
View
7 cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -204,7 +204,7 @@ function value($data, $column = null, $safe = false) {
return 'NULL';
}
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
- return "''";
+ return "''";
}
if (empty($column)) {
$column = $this->introspectType($data);
@@ -212,11 +212,14 @@ function value($data, $column = null, $safe = false) {
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)) {
Please sign in to comment.
Something went wrong with that request. Please try again.