提交 bbd4c307 编写于 作者: M martin f. krafft 提交者: Junio C Hamano

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: Nmartin f. krafft <madduck@madduck.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 f4574139
......@@ -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/"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册