changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r14771: LJSUP-3593: BML block 'PHP' has no close...

Committer: ssafronova
LJSUP-3593: BML block 'PHP' has no close

U   trunk/cgi-bin/LJ/Widget/RecentComments.pm
Modified: trunk/cgi-bin/LJ/Widget/RecentComments.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/RecentComments.pm	2009-01-15 08:57:15 UTC (rev 14770)
+++ trunk/cgi-bin/LJ/Widget/RecentComments.pm	2009-01-15 11:04:10 UTC (rev 14771)
@@ -51,13 +51,22 @@
         my $entry = $comment->entry;
         my $class_name = ($ct == scalar(@comments) - 1) ? "last" : "";
 
+        my $subject = $entry->subject_text ? $entry->subject_text : $class->ml('widget.recentcomments.nosubject');
+        my $body_part = substr($comment->body_text, 0, 250) . " ";
+
+        # prevent BML tags interpretation inside comment subject/body
+        $subject =~ s/<\?/<?/g;
+        $subject =~ s/\?>/?>/g;
+        $body_part =~ s/<\?/<?/g;
+        $body_part =~ s/\?>/?>/g;
+
         # print the comment
         $ret .= "<p class='pkg $class_name'>";
         $ret .= $comment->poster_userpic;
         $ret .= $class->ml('widget.recentcomments.commentheading', {'poster' => $poster, 'entry' => "<a href='" . $entry->url . "'>"});
-        $ret .= $entry->subject_text ? $entry->subject_text : $class->ml('widget.recentcomments.nosubject');
+        $ret .= $subject;
         $ret .= "</a><br />";
-        $ret .= substr($comment->body_text, 0, 250) . " ";
+        $ret .= $body_part;
         $ret .= "<span class='detail'>(<a href='" . $comment->url . "'>" . $class->ml('widget.recentcomments.link') . "</a>)</span> ";
         $ret .= "<span class='detail'>(<a href='" . $comment->reply_url . "'>" . $class->ml('widget.recentcomments.reply') . "</a>)</span> ";
         $ret .= "</p>";

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