Skip to content

Commit 92cdcc5

Browse files
committed
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
2 parents 9cd33bb + cacfc09 commit 92cdcc5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gitweb/gitweb.perl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ sub evaluate_uri {
5454
# to build the base URL ourselves:
5555
our $path_info = decode_utf8($ENV{"PATH_INFO"});
5656
if ($path_info) {
57+
# $path_info has already been URL-decoded by the web server, but
58+
# $my_url and $my_uri have not. URL-decode them so we can properly
59+
# strip $path_info.
60+
$my_url = unescape($my_url);
61+
$my_uri = unescape($my_uri);
5762
if ($my_url =~ s,\Q$path_info\E$,, &&
5863
$my_uri =~ s,\Q$path_info\E$,, &&
5964
defined $ENV{'SCRIPT_NAME'}) {

0 commit comments

Comments
 (0)