mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 19:12:42 +00:00
Fixing boolean conditions expression handling in DboSource::conditionKeysToString() and added test case (Ticket #2268)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4647 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
086a9cd97f
commit
c65f2a1fd2
2 changed files with 11 additions and 1 deletions
|
@ -1442,6 +1442,8 @@ class DboSource extends DataSource {
|
|||
$data = ' ' . $value;
|
||||
} elseif ($value === null || (is_array($value) && empty($value))) {
|
||||
$data = $this->name($key) . ' IS NULL';
|
||||
} elseif ($value === false || $value === true) {
|
||||
$data = $this->name($key) . " = " . $this->boolean($value);
|
||||
} elseif ($value === '') {
|
||||
$data = $this->name($key) . " = ''";
|
||||
} elseif (preg_match('/^([a-z]*\\([a-z0-9]*\\)\\x20?|(?:' . join('\\x20)|(?:', $this->__sqlOps) . '\\x20)|<=?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)?(.*)/i', $value, $match)) {
|
||||
|
@ -1563,7 +1565,6 @@ class DboSource extends DataSource {
|
|||
} else {
|
||||
$dir = '';
|
||||
}
|
||||
|
||||
$key = trim($this->name(trim($key)) . ' ' . trim($dir));
|
||||
}
|
||||
$order[] = $this->order($key . $value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue