Revision: [1696]
Adding fix to allow NULL values to be passed as a string or NULL setting the SQL to NULL or "NULL".




git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1697 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-01-01 05:04:23 +00:00
parent 6be00ac61a
commit 5193402736
2 changed files with 8 additions and 2 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
0.10.4.1695_beta
0.10.4.1697_beta

View file

@ -800,9 +800,15 @@ class Model extends Object
continue;
}
$fields[] = $x;
if($y === NULL)
{
$values[] = 'NULL';
}
else
{
$values[] = (ini_get('magic_quotes_gpc') == 1) ?
$this->db->prepare(stripslashes($y)) : $this->db->prepare($y);
}
if($x == $this->primaryKey && !is_numeric($y))
{
$newID = $y;