From 75d8f42684c6e3f4454e7cb0e0653e2b7f1b55a5 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 2 Feb 2007 02:21:44 +0000 Subject: [PATCH] Adding magic method fix for null query values (Ticket #1999), and adding PostgreSQL boolean quoting patch (Ticket #1788) git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4396 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index ddf9266b8..e15b272fc 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -126,7 +126,7 @@ class DboSource extends DataSource { $out[$keys[$i]] = $this->value($data[$keys[$i]]); } return $out; - } elseif (in_array($data, array('{$__cakeID__$}', '{$__cakeForeignKey__$}'))) { + } elseif (in_array($data, array('{$__cakeID__$}', '{$__cakeForeignKey__$}'), true)) { return $data; } else { return null; @@ -216,7 +216,7 @@ class DboSource extends DataSource { $c = 0; $query = array(); foreach ($field as $f) { - if (!is_array($params[$c])) { + if (!is_array($params[$c]) && !empty($params[$c])) { $query[$args[2]->name . '.' . $f] = '= ' . $params[$c]; } else { $query[$args[2]->name . '.' . $f] = $params[$c];