Committer: sbelyaev
LJSUP-11267: added clean html -> xhtml U trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl =================================================================== --- trunk/cgi-bin/ljprotocol.pl 2012-02-16 13:15:11 UTC (rev 21199) +++ trunk/cgi-bin/ljprotocol.pl 2012-02-16 13:22:38 UTC (rev 21200) @@ -18,6 +18,7 @@ LJ::EmbedModule LJ::DelayedEntry LJ::PushNotification + LJ::Tidy ); use LJ::TimeUtil; @@ -3906,7 +3907,13 @@ $t->[1] =~ s/\n/\r\n/g; } - $evt->{'event'} = $t->[1]; + if ($req->{'asxml'}) { + my $tidy = LJ::Tidy->new( { output => 'xml' } ); + my $event_text = $tidy->clean( $t->[1] ); + $evt->{'event'} = '<event>' . $event_text . '</event>'; + } else { + $evt->{'event'} = $t->[1]; + } } # maybe we don't need the props after all