Skip to content

Commit

Permalink
Escape project names before creating pathinfo URLs
Browse files Browse the repository at this point in the history
If a project name contains special URL characters like +, gitweb's links
break in subtle ways. The solution is to pass the project name through
esc_url() and using the return value.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
martin f. krafft authored and Junio C Hamano committed Apr 22, 2008
1 parent bbd4c30 commit 85d17a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ (%)
my ($use_pathinfo) = gitweb_check_feature('pathinfo');
if ($use_pathinfo) {
# use PATH_INFO for project name
$href .= "/$params{'project'}" if defined $params{'project'};
$href .= "/".esc_url($params{'project'}) if defined $params{'project'};
delete $params{'project'};

# Summary just uses the project path URL
Expand Down Expand Up @@ -2570,7 +2570,7 @@ sub git_header_html {
my $action = $my_uri;
my ($use_pathinfo) = gitweb_check_feature('pathinfo');
if ($use_pathinfo) {
$action .= "/$project";
$action .= "/".esc_url($project);
} else {
$cgi->param("p", $project);
}
Expand Down

0 comments on commit 85d17a1

Please sign in to comment.