Permalink
Browse files

Added check for NOT in key when array count === 1 to prevent SQL error

  • Loading branch information...
1 parent 7e9e3f9 commit e1738c8c4a52fafb5e7519449be0d234684075cc @scottharwell scottharwell committed Jan 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Model/Datasource/DboSource.php
@@ -2368,7 +2368,7 @@ public function conditionKeysToString($conditions, $quoteValues = true, $model =
$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 (';

0 comments on commit e1738c8

Please sign in to comment.