vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r19852: LJSUP-9628: remove some warnings from er...

Committer: vad
LJSUP-9628: remove some warnings from error log
U   trunk/cgi-bin/LJ/Share.pm
Modified: trunk/cgi-bin/LJ/Share.pm
===================================================================
--- trunk/cgi-bin/LJ/Share.pm	2011-08-25 11:25:12 UTC (rev 19851)
+++ trunk/cgi-bin/LJ/Share.pm	2011-08-25 16:05:24 UTC (rev 19852)
@@ -82,14 +82,18 @@
         $opts->{'description'}  = LJ::ejs( LJ::Text->drop_html($entry->event_raw) );
         $opts->{'url'}          = $entry->url;
 
-        $opts->{'title'}       = Encode::decode_utf8($opts->{'title'});
-        $opts->{'description'} = Encode::decode_utf8($opts->{description});
+        if ($opts->{'title'}){
+            $opts->{'title'}       = Encode::decode_utf8($opts->{'title'});
+            $opts->{'title'}       =~ s/\r|\n|\x85|\x{2028}|\x{2029}//gsm;
+            $opts->{'title'}       = Encode::encode_utf8($opts->{'title'});
+        }
 
-        $opts->{'title'}       =~ s/\r|\n|\x85|\x{2028}|\x{2029}//gsm;
-        $opts->{'description'} =~ s/\r|\n|\x85|\x{2028}|\x{2029}//gsm;
+        if ($opts->{'description'}){
+            $opts->{'description'} = Encode::decode_utf8($opts->{description});
+            $opts->{'description'} =~ s/\r|\n|\x85|\x{2028}|\x{2029}//gsm;
+            $opts->{'description'} = Encode::encode_utf8($opts->{description});
+        }
 
-        $opts->{'title'}       = Encode::encode_utf8($opts->{'title'});
-        $opts->{'description'} = Encode::encode_utf8($opts->{description});
     }
 
     my $opts_out = LJ::JSON->to_json($opts);

Tags: livejournal, pm, vadvs
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