diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-08-09 16:05:39 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2015-08-11 13:57:04 +0200 |
commit | da1153857f63babd0080c0d8ebd75d5f8400e6e9 (patch) | |
tree | a77c1b874e7a4ecb4adf6c1893c64549183c1a33 /web/lib/aurjson.class.php | |
parent | e8a6fe1efc3f4e546dd777babbb0264b6d073088 (diff) | |
download | aurweb-da1153857f63babd0080c0d8ebd75d5f8400e6e9.tar.xz |
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>
Diffstat (limited to 'web/lib/aurjson.class.php')
-rw-r--r-- | web/lib/aurjson.class.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index 7d94dab..e102fed 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -437,9 +437,13 @@ class AurJSON { */ private function msearch($http_data) { $maintainer = $http_data['arg']; - $maintainer = $this->dbh->quote($maintainer); - $where_condition = "Users.Username = $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); } |