summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/aurjson.class.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index be92c25..953f5ab 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -82,6 +82,10 @@ class AurJSON {
* @return mixed Returns an array of package matches.
**/
private function search($keyword_string) {
+ if (strlen($keyword_string) < 2) {
+ return $this->json_error('Query arg too small');
+ }
+
$keyword_string = mysql_real_escape_string($keyword_string, $this->dbh);
$query = sprintf(
"SELECT Name,ID FROM Packages WHERE ( Name LIKE '%%%s%%' OR Description LIKE '%%%s%%' ) AND DummyPkg=0",