mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing $conditions === true in DboSource
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4478 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
af4bacb960
commit
fbc0ea77b7
1 changed files with 4 additions and 2 deletions
|
@ -1326,7 +1326,9 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_string($conditions)) {
|
if ($conditions === true) {
|
||||||
|
return $clause . ' 1 = 1';
|
||||||
|
} elseif (is_string($conditions)) {
|
||||||
if (trim($conditions) == '') {
|
if (trim($conditions) == '') {
|
||||||
$conditions = ' 1 = 1';
|
$conditions = ' 1 = 1';
|
||||||
} else {
|
} else {
|
||||||
|
@ -1365,7 +1367,7 @@ class DboSource extends DataSource {
|
||||||
$clause = ' WHERE ';
|
$clause = ' WHERE ';
|
||||||
$out = $this->conditionKeysToString($conditions);
|
$out = $this->conditionKeysToString($conditions);
|
||||||
if (empty($out)) {
|
if (empty($out)) {
|
||||||
return $clause . ' (1 = 1)';
|
return $clause . ' 1 = 1';
|
||||||
}
|
}
|
||||||
return $clause . ' (' . join(') AND (', $out) . ')';
|
return $clause . ' (' . join(') AND (', $out) . ')';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue