From: Robert Fitzsimons Date: Sat, 23 Dec 2006 03:35:15 +0000 (+0000) Subject: gitweb: Require a minimum of two character for the search text. X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/6f0666cc276a8c52b654d1408a0cd6373bec153df8fcc8e7664f6d72e08deb70 gitweb: Require a minimum of two character for the search text. Signed-off-by: Robert Fitzsimons Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 84a3b1a..67549b8 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -352,6 +352,9 @@ if (defined $searchtext) { 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; }