From 282b6119e5aa8e7c679eb6c39aeaae5b16a8d6dd Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Wed, 26 Mar 2008 19:02:31 +0000 Subject: [PATCH] Unescape url returned from CGI::url to match PATH_INFO escaping. --- ChangeLog | 1 + blosxom.cgi | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index a2a2679..5a05b0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ v2.0.3 + * unescape url returned from CGI.pm to match PATH_INFO escaping * redo path_info handling with much stricter date tests * added support for multiple plugin directories using $plugin_path * changed plugin loading to use @INC instead of hardcoded diff --git a/blosxom.cgi b/blosxom.cgi index ee9bebc..29b9a54 100755 --- a/blosxom.cgi +++ b/blosxom.cgi @@ -144,6 +144,8 @@ my $fh = new FileHandle; # Use the stated preferred URL or figure it out automatically $url ||= url( -path_info => 1 ); +# Unescape %XX hex codes (from URI::Escape::uri_unescape) +$url =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; $url =~ s/^included:/http:/ if $ENV{SERVER_PROTOCOL} eq 'INCLUDED'; # NOTE: Since v3.12, it looks as if CGI.pm misbehaves for SSIs and -- 2.30.2