summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-10 15:23:46 -0700
committerJunio C Hamano <gitster@pobox.com>2012-09-10 15:23:46 -0700
commit3d4003bdc78095efce99149c0e6967f55edf8c53 (patch)
treea0e72a038275f79814c1c9060b819b6a5bc81058 /gitweb
parentb52183179bb0a97ea4d91d1248aca303d8e8f892 (diff)
parentcacfc09ba82bfc6b0e1c047247785d56a6054b2f (diff)
downloadgit-3d4003bdc78095efce99149c0e6967f55edf8c53.tar.gz
Merge branch 'js/gitweb-path-info-unquote' into maint-1.7.11
"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
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 55e0e9ea38..a40ed0ceb0 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'}) {