Adding fix for Ticket #2812

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5335 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-06-22 20:36:05 +00:00
parent f72cdb6670
commit 50aca85cc9

View file

@ -1561,6 +1561,7 @@ function conditionKeysToString($conditions, $quoteValues = true) {
$key = preg_replace('/' . $regs['1'] . '/', '', $key);
}
$not = false;
$mValue = trim($match['1']);
if (empty($match['1'])) {
$match['1'] = ' = ';
@ -1570,9 +1571,13 @@ function conditionKeysToString($conditions, $quoteValues = true) {
} elseif (!isset($match['2'])) {
$match['1'] = ' = ';
$match['2'] = $match['0'];
} else if(low($mValue) == 'not') {
$not = $this->conditionKeysToString(array($mValue => array($key => $match[2])), $quoteValues);
}
if (strpos($match['2'], '-!') === 0) {
if($not) {
$data = $not[0];
} elseif (strpos($match['2'], '-!') === 0) {
$match['2'] = str_replace('-!', '', $match['2']);
$data = $this->name($key) . ' ' . $match['1'] . ' ' . $match['2'];
} else {
@ -1813,4 +1818,4 @@ function conditionKeysToString($conditions, $quoteValues = true) {
}
}
?>
?>