From 13b93bb211ef82ac3fef7294b1fb1fa06c350c2e Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Mon, 30 May 2011 08:33:40 +0000 Subject: [PATCH] Bug 659816: Fix url_decoding of utf8 strings r=mkanat, a=mkanat git-svn-id: svn://10.0.0.236/trunk@262350 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Util.pm | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 0fbb3cfec21..9f8004f5f5b 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7827 \ No newline at end of file +7828 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Util.pm b/mozilla/webtools/bugzilla/Bugzilla/Util.pm index ced15491d04..4afdef1b404 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Util.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Util.pm @@ -243,14 +243,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; }