From: Andy Grundman Date: Tue, 3 Apr 2007 00:30:58 +0000 (+0000) Subject: Use regex for unescaping instead of URI::Escape X-Git-Tag: 5.7099_04~199 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=8c7d83e1a7ac65611e6063544e7f650a6270f5e6 Use regex for unescaping instead of URI::Escape --- diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 5c8b17f..0c42af6 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -7,7 +7,6 @@ use Data::Dump qw/dump/; use HTML::Entities; use HTTP::Body; use HTTP::Headers; -use URI::Escape (); use URI::QueryParam; use Scalar::Util (); @@ -641,12 +640,12 @@ as Apache may implement this using Apache's C-based modules, for example. =cut sub unescape_uri { - my $self = shift; + my ( $self, $str ) = @_; - my $e = URI::Escape::uri_unescape(@_); - $e =~ s/\+/ /g; + $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; + $str =~ s/\+/ /g; - return $e; + return $str; } =head2 $self->finalize_output