lib: Don't render empty filters to SQL

Else we are presented with syntax errors.

fixes #9211
This commit is contained in:
Eric Lippmann 2015-05-22 13:53:57 +02:00
parent 01b453eeb1
commit 83a6e85b5d
1 changed files with 6 additions and 4 deletions

View File

@ -166,10 +166,12 @@ class DbQuery extends SimpleQuery
$parts[] = $filterPart;
}
}
if ($level > 0) {
$str .= ' (' . implode($op, $parts) . ') ';
} else {
$str .= implode($op, $parts);
if (! empty($parts)) {
if ($level > 0) {
$str .= ' (' . implode($op, $parts) . ') ';
} else {
$str .= implode($op, $parts);
}
}
}
} else {