summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-08-22 11:52:32 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-08-22 11:52:32 -0700
commit92cdcc528402c4dc76a9facf3eb182cd9d659eb4 (patch)
tree2f710a9a2af8be5630f9e7b100ef81515e4f4374
parentMerge branch 'tr/void-diff-setup-done' (diff)
parentgitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO (diff)
downloadtgif-92cdcc528402c4dc76a9facf3eb182cd9d659eb4.tar.xz
Merge branch 'js/gitweb-path-info-unquote'
"gitweb" when used with PATH_INFO failed to notice directories with SP (and other characters that need URL-style quoting) in them. * js/gitweb-path-info-unquote: gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO
-rwxr-xr-xgitweb/gitweb.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3d6a705388..7f8c1878d4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -54,6 +54,11 @@ sub evaluate_uri {
# to build the base URL ourselves:
our $path_info = decode_utf8($ENV{"PATH_INFO"});
if ($path_info) {
+ # $path_info has already been URL-decoded by the web server, but
+ # $my_url and $my_uri have not. URL-decode them so we can properly
+ # strip $path_info.
+ $my_url = unescape($my_url);
+ $my_uri = unescape($my_uri);
if ($my_url =~ s,\Q$path_info\E$,, &&
$my_uri =~ s,\Q$path_info\E$,, &&
defined $ENV{'SCRIPT_NAME'}) {