gitweb: Split validate_input into validate_pathname and validate_refname
commit24d0693a68008baacd827b1345c957e871488596
authorJakub Narebski <jnareb@gmail.com>
Mon, 25 Sep 2006 23:57:02 +0000 (26 01:57 +0200)
committerJunio C Hamano <junkio@cox.net>
Wed, 27 Sep 2006 07:41:35 +0000 (27 00:41 -0700)
tree2976f3d666212dece1e35f00c729194ee1f0ea4b
parentdd1ad5f16708e49722ad455dea8076816054391d
gitweb: Split validate_input into validate_pathname and validate_refname

Split validate_input subroutine into validate_pathname which is used
for $project, $file_name and $file_parent parameters, and
validate_refname which is used for $hash, $hash_base, $hash_parent and
$hash_parent_base parameters.  Reintroduce validation of $file_name
and $file_parent parameters, removed in a2f3db2f

validate_pathname in addition to what validate_input did checks also
for doubled slashes and NUL character. It does not check if input is
textual hash, and does not check if all characters are from the
following set: [a-zA-Z0-9_\x80-\xff\ \t\.\/\-\+\#\~\%].

validate_refname first check if the input is textual hash, then checks
if it is valid pathname, then checks for invalid characters (according
to git-check-ref-format manpage). It does not check if all charactes
are from the [a-zA-Z0-9_\x80-\xff\ \t\.\/\-\+\#\~\%] set.

We do not have to validate pathnames we got from git.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl