Skip to content

Commit

Permalink
Added check for NOT in key when array count === 1 to prevent SQL error
Browse files Browse the repository at this point in the history
  • Loading branch information
scottharwell committed Jan 18, 2012
1 parent 7e9e3f9 commit e1738c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -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 (';
Expand Down

0 comments on commit e1738c8

Please sign in to comment.