Browse Source

Merge pull request #422 from scottharwell/2.1

Fixing possible SQL error when using 'field NOT' => array(1)
José Lorenzo Rodríguez 14 years ago
parent
commit
6211be2acc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Model/Datasource/DboSource.php

+ 1 - 1
lib/Cake/Model/Datasource/DboSource.php

@@ -2368,7 +2368,7 @@ class DboSource extends DataSource {
 					$keys = array_keys($value);
 					if ($keys === array_values($keys)) {
 						$count = count($value);
-						if ($count === 1) {
+						if ($count === 1 && !preg_match("/\s+NOT$/", $key)) {
 							$data = $this->_quoteFields($key) . ' = (';
 						} else {
 							$data = $this->_quoteFields($key) . ' IN (';