From: Shawn O. Pearce Date: Fri, 10 Oct 2008 15:01:08 GMT Subject: Re: [PATCHv2] gitweb: refactor input parameters parse/validation Message-ID: <20081010150108.GC29829@spearce.org> In-Reply-To: <1223457985-27094-1-git-send-email-giuseppe.bilotta@gmail.com> Giuseppe Bilotta wrote: > Since input parameters can be obtained both from CGI parameters and > PATH_INFO, we would like most of the code to be agnostic about the way > parameters were retrieved. We thus collect all the parameters into the > new %input_params hash, delaying validation after the collection is > completed. > @@ -672,6 +694,25 @@ sub href (%) { > ## ====================================================================== > ## validation, quoting/unquoting and escaping > > +sub validate_action { > + my $input = shift || return undef; > + return undef unless exists $actions{$action}; > + return $action; > +} Shouldn't $action here be $input? -- Shawn.