When creating a feed using Views > Format: RSS Feed, Show: Content, titles for items are encoded correctly. When creating a feed using Views > Format > Format: RSS Feed, Show: Fields, the titles for items are double encoded. For example:
RSS Feed - Content : <title>This title's apostrophe is rendered</title>
which correctly appears as "This title's apostrophe is rendered"
RSS Feed - Fields: <title>This title&#039;s apostrophe is rendered</title>
which incorrectly appears as "This title's apostrophe is rendered"
Double encoding occurs for apostrophes and ampersands. I have not tested other entities.
Comment | File | Size | Author |
---|---|---|---|
#6 | views-view-field--feed--title.tpl_.php_.zip | 927 bytes | didierlebouc |
Comments
Comment #1
Charles BelovComment #2
Charles BelovUsing a temporary workaround.
Added the following file to our website's theme:
views-view-field--feed--title.tpl.php
with the code:
print preg_replace(array('/"/', '/&/', '/'/'), array('"', '&', "'"), $output);
I understand that this is not exhaustive in terms of HTML entities, but it is sufficient for our use at the present time.
Comment #3
rooby CreditAttribution: rooby commentedComment #4
estebanhere CreditAttribution: estebanhere commented#2
Muchas gracias mi hermano, ese código me sirvio.
Thank you so much Charles Belov, that cod work for me!!
Comment #5
Arono974 CreditAttribution: Arono974 as a volunteer commented#2 Thanks for the trick Charles Belov, you made my day !
Comment #6
didierlebouc CreditAttribution: didierlebouc commentedPlease could you precise where exactly put this file or if anything needs to be added to the code.
I put the file named views-view-field--feed--title.tpl.php (see attachment) at sites/all/themes/NAME_of_my_theme directory and it doesn't work.
Thanks in advance.