summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-11-03 08:48:20 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2011-11-03 08:48:20 +0100
commit0557f7705ab12c84e53a5f2dc352557b908af511 (patch)
tree9034243d05d38e06b39952178ae61bd5486319cd
parent168a51431bda11d2250a26e8acb8b05c0876092e (diff)
RPC: Do not return an error on 0 results
Return an empty array and set the result count to zero instead. Before: $ curl 'http://localhost/rpc.php?type=search&arg=raboof' {"type":"error","resultcount":0,"results":"No results found"} After: $ curl 'http://localhost/rpc.php?type=search&arg=raboof' {"type":"search","resultcount":0,"results":[]} Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--web/lib/aurjson.class.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index 4b97d2b..c1b079a 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -152,7 +152,7 @@ class AurJSON {
return $this->json_results($type, $resultcount, $search_data);
}
else {
- return $this->json_error('No results found');
+ return $this->json_results($type, 0, array());
}
}