podlove / podlove-publisher

Podlove Podcast Publisher for WordPress
https://wordpress.org/plugins/podlove-podcasting-plugin-for-wordpress/
MIT License
299 stars 84 forks source link

Emoji encoded in RSS (itunes:summary and description) #1305

Open gpapp opened 2 years ago

gpapp commented 2 years ago

Expected behavior

When using emojis in the summary field, the RSS should emit valid values.

If I put "Summary ⚡" in the summary, the RSS should contain

<description><![CDATA[Summary ⚡]]></description>
...
<itunes:summary><![CDATA[Summary ⚡]]></itunes:summary>

in the RSS.

Actual behavior

RSS contains encoded htmlentities in the CDATA section. This is overencoding. Either use CDATA or encoded characters!

If I put "Summary &#x26a1;" in the summary, the RSS contains

<description><![CDATA[Summary &amp;#x26a1;]]></description>
...
<itunes:summary><![CDATA[Summary &amp;#x26a1;]]></itunes:summary>

in the RSS.

System information (see Podlove > Support menu)

Website https://zartosztaly.hu PHP Version 8.1.2 WordPress Version 6.0 WordPress Theme Zártosztály Podcast v2 v1.0 Active Plugins

0 errors 0 notices Nice, Everything looks fine!

gpapp commented 2 years ago

Converting the already HTML encoded characters back to normal solves the issue.

Line https://github.com/podlove/podlove-publisher/blob/8b9482bb2bf117b3c7ed02f9456439fe8f852114/lib/feeds/base.php#L27 should read return apply_filters('podlove_feed_item_description', html_entity_decode($description));

https://github.com/podlove/podlove-publisher/blob/8b9482bb2bf117b3c7ed02f9456439fe8f852114/lib/feeds/base.php#L390 should be $summary = apply_filters('podlove_feed_content', \Podlove\PHP\escape_shortcodes(html_entity_decode($episode->summary)));

eteubert commented 1 year ago

Would be a good idea to check that this is handled correctly everywhere, I opened a dedicated issue: #1392