bugfix in WhereClause: negate didn't wrap multiple clauses in extra parens
Fixes #41
This commit is contained in:
@@ -873,8 +873,8 @@ class WhereClause {
|
||||
$args = array_merge($args, $clause_args);
|
||||
}
|
||||
|
||||
if ($this->type == 'and') $sql = implode(' AND ', $sql);
|
||||
else $sql = implode(' OR ', $sql);
|
||||
if ($this->type == 'and') $sql = sprintf('(%s)', implode(' AND ', $sql));
|
||||
else $sql = sprintf('(%s)', implode(' OR ', $sql));
|
||||
|
||||
if ($this->negate) $sql = '(NOT ' . $sql . ')';
|
||||
return array($sql, $args);
|
||||
|
||||
Reference in New Issue
Block a user