From 5929efb780420577e492493f1d6b04050cf8729f Mon Sep 17 00:00:00 2001 From: Eduardo Martos Date: Thu, 18 Mar 2021 17:15:33 +0100 Subject: [PATCH] Adds compatibility with media:content tags. It is required for retrieving featured images from the RSS feed. --- src/RSS_PHP/rss_php.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/RSS_PHP/rss_php.php b/src/RSS_PHP/rss_php.php index f2a0b493..f2418aa8 100755 --- a/src/RSS_PHP/rss_php.php +++ b/src/RSS_PHP/rss_php.php @@ -125,6 +125,13 @@ private function extractDOM($nodeList,$parentNodeName=false) { $this->channel[$values->nodeName] = $tempNode[$nodeName]; } } + if($values->nodeName == 'media:content') { + for($i=0;$values->attributes->item($i);$i++) { + if ($values->attributes->item($i)->name == 'url') { + $tempNode[$nodeName] = $values->attributes->item($i)->nodeValue; + } + } + } } elseif(substr($values->nodeName,1) == 'text') { $tempValue = trim(preg_replace('/\s\s+/',' ',str_replace("\n",' ', $values->textContent))); if($tempValue) { @@ -157,4 +164,4 @@ private function randomContext() { } -?> \ No newline at end of file +?>