Hi Forum,
I quite liked the Recent Page Comments Widget, so I added it to my blog. However, some spam posts that managed to pass the Akismet spam protection broke my website completely. All pages that contained the Recent Page Comment Widget displayed a rather ugly error message pointing at a blockquote end tag.
This is hardly surprising because the Recent Pages Comments Widget limits the characters that are displayed without considering that it may just leave an unclosed html tag behind. Here is an example:
This is <a href="http://www.i-eat-your-soul.com/annoying/nasty/evil/">spam</a>.
If this is trimmed it becomes
This is <a href="http://www.i-eat
and is rendered as something like
<blockquote>This is <a href="http://www.i-eat</blockquote>
So Silverstripe notices that the html of this page is completely messed up and complains with an error message.
A quick way to fix this is to make a small change in the silverstripe_root_directory/widgets_pagecomments/PageCommentsWidget.php file. Add the bold blue code to line 39:
$holder->setValue(strip_tags($row->Comment));
This should strip out all html tags before the string is trimmed to a certain character length.
Cheers!
Anatol