diff --git a/plugins/serendipity_plugin_comments/ChangeLog b/plugins/serendipity_plugin_comments/ChangeLog index 6a9d3f67..5bf3126a 100644 --- a/plugins/serendipity_plugin_comments/ChangeLog +++ b/plugins/serendipity_plugin_comments/ChangeLog @@ -1,3 +1,8 @@ +Version 1.17: +------------------------------------------------------------------------ +* Fix: Don't strip HTML tags from comment body before truncating if + serendipity_event_unstrip_tags is active, so it may actually + preserve the tags (and replace them with entities). Version 1.16: ------------------------------------------------------------------------ * Fix: wordwrap at word boundaries instead of "truncating" the lines diff --git a/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php b/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php index cd586709..657005db 100644 --- a/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php +++ b/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php @@ -20,7 +20,7 @@ class serendipity_plugin_comments extends serendipity_plugin $propbag->add('description', PLUGIN_COMMENTS_BLAHBLAH); $propbag->add('stackable', true); $propbag->add('author', 'Garvin Hicking, Tadashi Jokagi, Judebert, G. Brockhaus'); - $propbag->add('version', '1.16'); + $propbag->add('version', '1.17'); $propbag->add('requirements', array( 'serendipity' => '1.6', 'smarty' => '2.6.7', @@ -193,11 +193,17 @@ class serendipity_plugin_comments extends serendipity_plugin if ($sql && is_array($sql)) { foreach($sql AS $key => $row) { + # don't strip HTML tags if serendipity_event_unstrip_tags is active + if (!class_exists('serendipity_event_unstrip_tags')) { + $comment = strip_tags($row['comment']); + } else { + $comment = $row['comment']; + } # truncate comment to $max_chars if (function_exists('mb_strimwidth')) { - $comment = mb_strimwidth(strip_tags($row['comment']), 0, $max_chars, " [...]", LANG_CHARSET); + $comment = mb_strimwidth($comment, 0, $max_chars, " [...]", LANG_CHARSET); } else { - $comments = wordwrap(strip_tags($row['comment']), $max_chars, '@@@', 1); + $comments = wordwrap($comment, $max_chars, '@@@', 1); $aComment = explode('@@@', $comments); $comment = $aComment[0]; if (count($aComment) > 1) {