[unstrip_tags] Don't touch entry RSS feeds!

The HTML escaping needs to be restricted
to comment (and trackback) feeds to avoid
escaping "legal" HTML in entry feeds.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2020-04-29 13:43:03 +02:00
parent cb4c188959
commit ace82351d2
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,7 @@
1.4.1:
------
* Don't touch (and HTML escape) entry RSS feeds!
1.4:
----

View file

@ -24,7 +24,7 @@ class serendipity_event_unstrip_tags extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_UNSTRIP_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking, Thomas Hochstein');
$propbag->add('version', '1.4');
$propbag->add('version', '1.4.1');
$propbag->add('requirements', array(
'serendipity' => '0.7',
'smarty' => '2.6.7',
@ -56,9 +56,11 @@ class serendipity_event_unstrip_tags extends serendipity_event
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));
if (isset($addData['comments']) && $addData['comments']) {
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;