madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20896: LJSUP-10930: fix unicode in subject

Committer: sbelyaev
LJSUP-10930: fix unicode in subject
U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-01-13 13:46:09 UTC (rev 20895)
+++ trunk/cgi-bin/cleanhtml.pl	2012-01-13 15:30:55 UTC (rev 20896)
@@ -1311,9 +1311,12 @@
 
                     unless ($subject){
                         $subject = LJ::ehtml($entry->subject_raw || LJ::Lang::ml("repost.default_subject"));
-                        $subject = Encode::decode_utf8($subject) if $subject;
                     }
 
+                    if ($subject && Encode::is_utf8($subject)) {
+                        $subject = Encode::encode_utf8($subject);
+                    }
+
                     ## 'posterid' property of a removed (is_valied eq 'false') entry is empty.
                     my $poster_username = $entry->poster
                                             ? $entry->poster->username
@@ -1326,7 +1329,9 @@
                                                 subject  => $subject,
                                                 text     => Encode::encode_utf8($captured),
                                                 });
+
                     $captured = Encode::decode_utf8($captured);
+                    $subject  = Encode::decode_utf8($subject) if $subject;
                 }
                 $captured = LJ::ehtml($captured);
 

Tags: livejournal, madeon, pl, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments