How can I get the Joomla 4 RSS to render single quotes as single quotes in the RSS feed? I get this ' instead of a single quote.
As a result the email notices of the RSS feed also show this oddity.
Create article with single quote in title then save and view RSS
The Feed should read. "<title>You Know You're Different - How Can You Prove It?</title>"
RSS feed tile says, "<title>You Know You're Different - How Can You Prove It?</title>"
See attached TXT file
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
I believe that the line of code is
I think you are correct. How do we get the output to be a single quote for the feed though. I can see the htmlspecialchars is doing its job.
Do you have any thoughts on how to render character correctly for Feed?
Labels |
Added:
bug
|
I can no longer replicate this error - perhaps it was solved elsewhere?
Can you please try to test this with:
htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT | ENT_XML1, 'UTF-8')
Or just:
htmlspecialchars(strip_tags($data->items[$i]->title), ENT_XML1, 'UTF-8')
The problem is that there are two different sets of code that is used for sanitizing the title.
If its a blog or list category then it uses
joomla-cms/libraries/src/MVC/View/CategoryFeedView.php
Lines 86 to 89 in 2a8b6bb
But if it is features articles (or some of the other components) then it uses
joomla-cms/components/com_content/src/View/Featured/FeedView.php
Lines 56 to 58 in 2a8b6bb
Labels |
Added:
PBF
|
Labels |
Removed:
PBF
|
I wasn't sure if you meant the RSS title or the RSS Item Title so I tried both
As can be seen the problem is on the item title only.
Hope that helps someone debug this