]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 659816: Fix url_decoding of utf8 strings
authorByron Jones <bjones@mozilla.com>
Mon, 30 May 2011 08:20:32 +0000 (16:20 +0800)
committerByron Jones <bjones@mozilla.com>
Mon, 30 May 2011 08:20:32 +0000 (16:20 +0800)
r=mkanat, a=mkanat

Bugzilla/Util.pm

index b1655f7ca08ea3ffc80e2fc7692d608dd86d7932..1129cb0ae659905759dacc5b78c96ce87650e267 100644 (file)
@@ -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;
 }