Before, we were only checking utf8 encoding for subject and event.
It's better
to handle all utf8 strings from the request properly, using the Encode
module.
Codemerge from LiveJournal; prepared for Dreamwidth by <user
name=denise>.
diffs (25 lines):
diff -r 99ed26f60316 -r c1e5d7213dfc cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm Wed Jun 30 02:12:57 2010 +0800
+++ b/cgi-bin/Apache/LiveJournal.pm Tue Jun 29 14:37:20 2010 -0500
@@ -1804,6 +1804,7 @@ sub anti_squatter
}
package LJ::Protocol;
+use Encode();
sub xmlrpc_method {
my $method = shift;
@@ -1818,10 +1819,9 @@ sub xmlrpc_method {
}
my $error = 0;
if (ref $req eq "HASH") {
- foreach my $key ('subject', 'event') {
- # get rid of the UTF8 flag in scalars
- $req->{$key} = LJ::no_utf8_flag ( $req->{$key} )
- if $req->{$key};
+ # get rid of the UTF8 flag in scalars
+ while ( my ($k, $v) = each %$req ) {
+ $req->{$k} = Encode::encode_utf8($v) if Encode::is_utf8($v);
}
}
my $res = LJ::Protocol::do_request($method, $req, \$error);
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog