rpc: msearch: Give orphans on empty maintainer argument

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Johannes Löthberg 2015-08-09 16:05:39 +02:00 committed by Lukas Fleischer
parent e8a6fe1efc
commit da1153857f

View file

@ -437,9 +437,13 @@ class AurJSON {
*/
private function msearch($http_data) {
$maintainer = $http_data['arg'];
$maintainer = $this->dbh->quote($maintainer);
if (empty($maintainer)) {
$where_condition = "Users.ID is NULL";
} else {
$maintainer = $this->dbh->quote($maintainer);
$where_condition = "Users.Username = $maintainer ";
}
return $this->process_query('msearch', $where_condition);
}