Merge pull request #702 from th-h/thh-plugin-comments
[plugin_comments] Don't strip HTML unconditionally.
This commit is contained in:
commit
e60dd8dd2d
@ -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
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user