]> Lady’s Gitweb - Gitweb/commit
gitweb: Split validate_input into validate_pathname and validate_refname
authorJakub Narebski <redacted>
Mon, 25 Sep 2006 23:57:02 +0000 (01:57 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
commit42de3c30fd1944ef90e23f370566fee62c7d9a6b0563ff16c641280de58b44fd
tree398591c752100e96f4ba711f6bc4eb17df59e6fc44ad252f1a3c6d5d62b52d4f
parent379faf51f0c4e0a073f489fe1bb7f1ea03ecfbd1e153e9be2b62501fba354842
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.247869 seconds and 4 git commands to generate.