Skip to content

Commit bbd4c30

Browse files
madduckgitster
authored andcommitted
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>
1 parent f457413 commit bbd4c30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitweb/gitweb.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ sub evaluate_path_info {
506506
}
507507
# do not change any parameters if an action is given using the query string
508508
return if $action;
509-
$path_info =~ s,^$project/*,,;
509+
$path_info =~ s,^\Q$project\E/*,,;
510510
my ($refname, $pathname) = split(/:/, $path_info, 2);
511511
if (defined $pathname) {
512512
# we got "project.git/branch:filename" or "project.git/branch:dir/"

0 commit comments

Comments
 (0)