gitweb: Require a minimum of two character for the search text.
authorRobert Fitzsimons <robfitz@273k.net>
Sat, 23 Dec 2006 03:35:15 +0000 (03:35 +0000)
committerJunio C Hamano <junkio@cox.net>
Sat, 23 Dec 2006 07:18:41 +0000 (23:18 -0800)
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl
index c1e8bbc3cb620fd0dd64edbf597c6ad2945e08a8..9061c4a75e6b491686aa3906adc4352d6145f2ae 100755 (executable)
@@ -351,6 +351,9 @@ sub check_export_ok {
        if ($searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
                die_error(undef, "Invalid search parameter");
        }
+       if (length($searchtext) < 2) {
+               die_error(undef, "At least two characters are required for search parameter");
+       }
        $searchtext = quotemeta $searchtext;
 }