Regression v1.4.13 due to fix for #25

Issue #26 resolved
tristanleboss created an issue

Hello,

The fix that was applied to solve #25 introduced a regression. Indeed, if you have accented letters in your <media:copyright> or <media:title> tags, using "htmlentities" will replace them with their html entities counterpart. Unfortunately, this should not be done in XML! Indeed, the XML will not be valid after that and the RSS feed will be broken.

For example, with the new version:

<media:copyright>Light ZOOM Lumière</media:copyright>

is replaced with:

<media:copyright>Light ZOOM Lumi&egrave;re</media:copyright>

Which gives an error: "error on line 36 at column 42: Entity 'egrave' not defined".

The correct function to use is: http://php.net/manual/fr/function.htmlspecialchars.php

This function only replace the characters that may break XML.

http://stackoverflow.com/questions/2822774/php-is-htmlentities-sufficient-for-creating-xml-safe-values

Tristan

Comments (4)

  1. Ladislav Soukup repo owner

    Hello, sorry for the bug and thank you for your report! I didn't test the release properly with international chars :( and I didn't know that htmlentities() will break the XML... There is always something to learn... :) Should be fixed now.

  2. tristanleboss reporter

    Thanks for the quick action. You're welcome. I was also not aware of it before the bug appeared... ;) but I had to quickly find a solution.

  3. Log in to comment