From 8dfcbc25ff68522f974a952dd36ba4b71bb9e215 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 30 May 2011 16:20:32 +0800 Subject: [PATCH] Bug 659816: Fix url_decoding of utf8 strings r=mkanat, a=mkanat --- Bugzilla/Util.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index b1655f7ca0..1129cb0ae6 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -240,14 +240,11 @@ sub xml_quote { return $var; } -# This function must not be relied upon to return a valid string to pass to -# the DB or the user in UTF-8 situations. The only thing you can rely upon -# it for is that if you url_decode a string, it will url_encode back to the -# exact same thing. sub url_decode { my ($todecode) = (@_); $todecode =~ tr/+/ /; # pluses become spaces $todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge; + utf8::decode($todecode) if Bugzilla->params->{'utf8'}; return $todecode; } -- 2.47.2