Bug 659816: Fix url_decoding of utf8 strings

r=mkanat, a=mkanat


git-svn-id: svn://10.0.0.236/branches/BUGZILLA-4_0-BRANCH@262350 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org 2011-05-30 08:33:40 +00:00
parent 4de0952ec6
commit f82b7bde18
2 changed files with 2 additions and 5 deletions

View File

@ -1 +1 @@
7600
7601

View 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;
}