Adding fix from Ticket #2074

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4569 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-03-04 04:05:57 +00:00
parent 5cdb3bfc91
commit 82d0c2e742
2 changed files with 16 additions and 4 deletions

View file

@ -251,12 +251,18 @@ class DboMysql extends DboSource {
case 'boolean':
$data = $this->boolean((bool)$data);
break;
case 'integer' :
case 'float' :
case null :
if(is_numeric($data)) {
break;
}
default:
$data = mysql_real_escape_string($data, $this->connection);
$data = "'" . mysql_real_escape_string($data, $this->connection) . "'";
break;
}
return "'" . $data . "'";
return $data;
}
/**
* Begin a transaction

View file

@ -225,12 +225,18 @@ class DboMysqli extends DboSource {
case 'boolean':
$data = $this->boolean((bool)$data);
break;
case 'integer' :
case 'float' :
case null :
if(is_numeric($data)) {
break;
}
default:
$data = mysqli_real_escape_string($this->connection, $data);
$data = "'" . mysqli_real_escape_string($this->connection, $data) . "'";
break;
}
return "'" . $data . "'";
return $data;
}
/**
* Begin a transaction