mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merged
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:
parent
6be00ac61a
commit
5193402736
2 changed files with 8 additions and 2 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
0.10.4.1695_beta
|
||||
0.10.4.1697_beta
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue