Skip to content
Snippets Groups Projects
Verified Commit e8db570e authored by Dave Long's avatar Dave Long
Browse files

Issue #3424768 by mfb, OMD, cilefen, smustgrave: Channel description of RSS feeds is double-escaped

parent d7602652
No related branches found
No related tags found
No related merge requests found
...@@ -57,10 +57,12 @@ protected function transformRootRelativeUrlsToAbsolute($rss_markup, Request $req ...@@ -57,10 +57,12 @@ protected function transformRootRelativeUrlsToAbsolute($rss_markup, Request $req
// Invoke Html::transformRootRelativeUrlsToAbsolute() on all HTML content // Invoke Html::transformRootRelativeUrlsToAbsolute() on all HTML content
// embedded in this RSS feed. // embedded in this RSS feed.
foreach ($rss_dom->getElementsByTagName('description') as $node) { foreach ($rss_dom->getElementsByTagName('item') as $item) {
$html_markup = $node->nodeValue; foreach ($item->getElementsByTagName('description') as $node) {
if (!empty($html_markup)) { $html_markup = $node->nodeValue;
$node->replaceChild($rss_dom->createTextNode(Html::transformRootRelativeUrlsToAbsolute($html_markup, $request->getSchemeAndHttpHost())), $node->firstChild); if (!empty($html_markup)) {
$node->replaceChild($rss_dom->createTextNode(Html::transformRootRelativeUrlsToAbsolute($html_markup, $request->getSchemeAndHttpHost())), $node->firstChild);
}
} }
} }
......
...@@ -26,7 +26,7 @@ public static function providerTestOnResponse() { ...@@ -26,7 +26,7 @@ public static function providerTestOnResponse() {
<channel> <channel>
<title>Drupal.org</title> <title>Drupal.org</title>
<link>https://www.drupal.org</link> <link>https://www.drupal.org</link>
<description>Come for the software, stay for the community <description>Come for the software &amp; stay for the community
Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.</description> Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.</description>
<language>en</language> <language>en</language>
<item> <item>
...@@ -45,7 +45,7 @@ public static function providerTestOnResponse() { ...@@ -45,7 +45,7 @@ public static function providerTestOnResponse() {
<channel> <channel>
<title>Drupal.org</title> <title>Drupal.org</title>
<link>https://www.drupal.org</link> <link>https://www.drupal.org</link>
<description>Come for the software, stay for the community <description>Come for the software &amp; stay for the community
Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.</description> Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.</description>
<language>en</language> <language>en</language>
<item> <item>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment