Unescape url returned from CGI::url to match PATH_INFO escaping.
[matthijs/upstream/blosxom.git] / blosxom.cgi
index ee9bebc03717f46c203afef2366d0926221fe88f..29b9a540d4ebf6022a0e38a47ba1cb9de0f799f8 100755 (executable)
@@ -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