提交 fb098a94 编写于 作者: G Giuseppe Bilotta 提交者: Junio C Hamano

gitweb: don't use pathinfo for global actions

With PATH_INFO urls, actions for the projects list (e.g. opml,
project_index) were being put in the URL right after the base. The
resulting URL is not properly parsed by gitweb itself, since it expects
a project name as first component of the URL.

Accepting global actions in use_pathinfo is not a very robust solution
due to possible present and future conflicts between project names and
global actions, therefore we just refuse to create PATH_INFO URLs when
the project is not defined.
Signed-off-by: NGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: NJakub Narebski <jnareb@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 df63fbbf
......@@ -830,7 +830,7 @@ (%)
}
my $use_pathinfo = gitweb_check_feature('pathinfo');
if ($use_pathinfo) {
if ($use_pathinfo and defined $params{'project'}) {
# try to put as many parameters as possible in PATH_INFO:
# - project name
# - action
......@@ -845,7 +845,7 @@ (%)
$href =~ s,/$,,;
# Then add the project name, if present
$href .= "/".esc_url($params{'project'}) if defined $params{'project'};
$href .= "/".esc_url($params{'project'});
delete $params{'project'};
# since we destructively absorb parameters, we keep this
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册