mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Added check for NOT in key when array count === 1 to prevent SQL error
This commit is contained in:
parent
7e9e3f92a7
commit
e1738c8c4a
1 changed files with 1 additions and 1 deletions
|
@ -2368,7 +2368,7 @@ class DboSource extends DataSource {
|
||||||
$keys = array_keys($value);
|
$keys = array_keys($value);
|
||||||
if ($keys === array_values($keys)) {
|
if ($keys === array_values($keys)) {
|
||||||
$count = count($value);
|
$count = count($value);
|
||||||
if ($count === 1) {
|
if ($count === 1 && !preg_match("/\s+NOT$/", $key)) {
|
||||||
$data = $this->_quoteFields($key) . ' = (';
|
$data = $this->_quoteFields($key) . ' = (';
|
||||||
} else {
|
} else {
|
||||||
$data = $this->_quoteFields($key) . ' IN (';
|
$data = $this->_quoteFields($key) . ' IN (';
|
||||||
|
|
Loading…
Add table
Reference in a new issue