1
0
mirror of https://github.com/git/git.git synced 2024-09-21 22:32:56 +02:00

Escape project name in regexp

The project name, when used in a regular expression, needs to be quoted
properly, so that stuff like '++' in the project name does not cause
Perl to barf.

Related info: http://bugs.debian.org/476076
This is a bug in Perl's CGI.pm, but fixing that exposed a similar bug in
gitweb.perl

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
martin f. krafft 2008-04-20 23:03:56 +02:00 committed by Junio C Hamano
parent f457413908
commit bbd4c307fc

View File

@ -506,7 +506,7 @@ sub evaluate_path_info {
}
# do not change any parameters if an action is given using the query string
return if $action;
$path_info =~ s,^$project/*,,;
$path_info =~ s,^\Q$project\E/*,,;
my ($refname, $pathname) = split(/:/, $path_info, 2);
if (defined $pathname) {
# we got "project.git/branch:filename" or "project.git/branch:dir/"