[unstrip_tags] Apply to comment RSS feeds, too.

Add ChangeLog.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2020-04-24 14:08:08 +02:00
parent c74dcd8fc8
commit 9a7127bf5f
2 changed files with 16 additions and 2 deletions

View file

@ -0,0 +1,4 @@
1.4:
----
* Unstrip (escape) HTML tags in comment RSS feeds, too.

View file

@ -24,14 +24,14 @@ class serendipity_event_unstrip_tags extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_UNSTRIP_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking');
$propbag->add('version', '1.03.1');
$propbag->add('version', '1.4');
$propbag->add('requirements', array(
'serendipity' => '0.7',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('groups', array('MARKUP'));
$propbag->add('event_hooks', array('frontend_display' => true, 'frontend_comment' => true));
$propbag->add('event_hooks', array('frontend_display' => true, array('frontend_entries_rss' => true, 'frontend_comment' => true));
}
function generate_content(&$title) {
@ -52,6 +52,16 @@ class serendipity_event_unstrip_tags extends serendipity_event
return true;
break;
case 'frontend_entries_rss':
foreach ($eventData as $entry => $entryData) {
if (!empty($entryData['body'])) {
$eventData[$entry]['body'] = (function_exists('serendipity_specialchars') ? serendipity_specialchars($entryData['body']) : htmlspecialchars($entryData['body'], ENT_COMPAT, LANG_CHARSET));
}
}
return true;
break;
case 'frontend_comment':
echo '<div class="serendipity_commentDirection serendipity_comment_unstrip_tags">' . PLUGIN_EVENT_UNSTRIP_TRANSFORM . '</div>';
return true;