Channel description of RSS feeds is double-escaped

Created on 29 February 2024, about 1 year ago
Updated 19 March 2024, about 1 year ago

Problem/Motivation

This is a followup from πŸ› [10.2 regression] RSS feeds invalid due to   Fixed .

RSS feeds are now valid but have a warning on the W3C feed validator:

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

line 6, column 42: description should not contain HTML: &

<description>Training &amp;amp; Events</description>

Steps to reproduce

Create a feed in views with an RSS channel description that contains an ampersand, e.g. "Training & Events". Channel description is a field in the Feed:Style options setting section in views.

Checking the feed output against https://validator.w3.org it prints a warning for the channel description line: "description should not contain HTML: &amp;". The RSS feed literally contains &amp;amp; which is parsed into human-readable text &amp;. It should contain &amp; which is parsed as human-readable text &.

Proposed resolution

The \Drupal\Core\EventSubscriber\RssResponseRelativeUrlFilter::transformRootRelativeUrlsToAbsolute() method processes all RSS feed description elements as markup. However, RSS has two different kinds of description elements: item description elements, which according to the RSS specs are interpreted as markup, and channel description elements, which are interpreted as human-readable. So that method should skip channel description elements.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

10.2 ✨

Component
BaseΒ  β†’

Last updated 24 minutes ago

Created by

πŸ‡¨πŸ‡¦Canada OMD

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024