]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO
[Gitweb] / gitweb.perl
index 78e04e413a31f7b82bfc9ede76381f2fc7b35dd3ca44b7c5af51e41b10f78aef..5fe7fdcf9b4033b253ee7b62f5ed88328e1ac315bece5f2cf89ba0af68b72205 100755 (executable)
@@ -54,6 +54,11 @@ sub evaluate_uri {
        # to build the base URL ourselves:
        our $path_info = decode_utf8($ENV{"PATH_INFO"});
        if ($path_info) {
        # 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'}) {
                if ($my_url =~ s,\Q$path_info\E$,, &&
                    $my_uri =~ s,\Q$path_info\E$,, &&
                    defined $ENV{'SCRIPT_NAME'}) {
This page took 0.215643 seconds and 4 git commands to generate.