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:
nate 2007-02-08 18:13:14 +00:00
parent af4bacb960
commit fbc0ea77b7

View file

@ -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) == '') {
$conditions = ' 1 = 1';
} else {
@ -1365,7 +1367,7 @@ class DboSource extends DataSource {
$clause = ' WHERE ';
$out = $this->conditionKeysToString($conditions);
if (empty($out)) {
return $clause . ' (1 = 1)';
return $clause . ' 1 = 1';
}
return $clause . ' (' . join(') AND (', $out) . ')';
}