summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2011-05-30 10:19:06 +0200
committerByron Jones <bjones@mozilla.com>2011-05-30 10:19:06 +0200
commit253213a4b805521bedbb356ab4ad6e1e0a326112 (patch)
tree54f8a75141bf5a9ad4f3c0910f12ff26c1c29369
parentb1afdcf8b033fb1dbff84b16c1f0926e279955e2 (diff)
downloadbugzilla-253213a4b805521bedbb356ab4ad6e1e0a326112.tar.gz
bugzilla-253213a4b805521bedbb356ab4ad6e1e0a326112.tar.xz
Bug 659816: Fix url_decoding of utf8 strings
r=mkanat, a=mkanat
-rw-r--r--Bugzilla/Util.pm5
1 files changed, 1 insertions, 4 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index ced15491d..4afdef1b4 100644
--- a/Bugzilla/Util.pm
+++ b/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;
}