gitweb: Require a minimum of two character for the search text.
[gitweb.git] / 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;
 }