From 2ea8e4edee0c407c3f7d8fd7a5b210da1b768588 Mon Sep 17 00:00:00 2001 From: nate Date: Sat, 23 Dec 2006 21:24:30 +0000 Subject: [PATCH] Adding NOT query conditions fix for Ticket #1793 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4167 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 14a20aa1b..14f920681 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1349,14 +1349,14 @@ class DboSource extends DataSource { $c = 0; $data = null; $out = array(); - $bool = array('and', 'or', 'and not', 'or not', 'xor', '||', '&&'); + $bool = array('and', 'or', 'not', 'and not', 'or not', 'xor', '||', '&&'); $join = ' AND '; foreach($conditions as $key => $value) { if (in_array(strtolower(trim($key)), $bool)) { $join = ' ' . strtoupper($key) . ' '; $value = $this->conditionKeysToString($value); - if (strpos($join, 'NOT')) { + if (strpos($join, 'NOT') !== false) { $out[] = 'NOT (' . join(') ' . strtoupper($key) . ' (', $value) . ')'; } else { $out[] = '(' . join(') ' . strtoupper($key) . ' (', $value) . ')';