From 9d032c725034e7c072f8c1a3e11855594c2fc0af Mon Sep 17 00:00:00 2001 From: Robert Fitzsimons Date: Sat, 23 Dec 2006 03:35:15 +0000 Subject: [PATCH] gitweb: Require a minimum of two character for the search text. Signed-off-by: Robert Fitzsimons Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c1e8bbc3cb..9061c4a75e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -351,6 +351,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; } -- 2.11.4.GIT