Committer: vad
LJSUP-9158: Error with loading second page in FriendsTimes.U trunk/cgi-bin/LJ/Share.pm
Modified: trunk/cgi-bin/LJ/Share.pm =================================================================== --- trunk/cgi-bin/LJ/Share.pm 2011-07-01 09:21:35 UTC (rev 19416) +++ trunk/cgi-bin/LJ/Share.pm 2011-07-01 09:23:47 UTC (rev 19417) @@ -78,9 +78,18 @@ my ( $class, $opts ) = @_; if ( my $entry = delete $opts->{'entry'} ) { - $opts->{'title'} = LJ::Text->drop_html($entry->subject_raw); - $opts->{'description'} = LJ::Text->drop_html($entry->event_raw); + $opts->{'title'} = LJ::ejs( LJ::Text->drop_html($entry->subject_raw) ); + $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}); + + $opts->{'title'} =~ s/\r|\n|\x85|\x{2028}|\x{2029}//gsm; + $opts->{'description'} =~ s/\r|\n|\x85|\x{2028}|\x{2029}//gsm; + + $opts->{'title'} = Encode::encode_utf8($opts->{'title'}); + $opts->{'description'} = Encode::encode_utf8($opts->{description}); } my $opts_out = LJ::JSON->to_json($opts);