[3.0.x.x] Use CDATA for image caption and title and add linebreaks#15069
[3.0.x.x] Use CDATA for image caption and title and add linebreaks#15069mhcwebdesign merged 1 commit intoopencart:3.0.x.xfrom
Conversation
|
You shouldn't need CDATA around $product['name'] as that will already be escaped in the database. If it's not then you will have bigger problems. |
Yes I know it will be escaped. In our products it escapes special characters as well. For example it makes |
That's because XML only has 5 predefined character entities, unlike HTML. When you wrap in CDATA you are saying to ignore any markup. So once parsed the result is In your case you would need to decode the entities and then just encode the ones valid in XML. Or use a numeric character reference. |
Agree. Just tested it with the |
This PR changes two things for the Google Sitemap extension.
PHP_EOLto each line to make the file readable when you open it as a humanCDATAfor image caption and image title. Without this the feed generation will result in an invalid feed when your caption is using html formatted special characters. For example:ä