From 6833dd05ab51bc530d34fd4174ad732f623226c0 Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Sat, 29 Jul 2023 08:04:19 +0000 Subject: [PATCH] fix(rss): update podcast extension namespace refs #360 --- app/Entities/Episode.php | 4 ++-- app/Entities/Podcast.php | 4 ++-- app/Helpers/rss_helper.php | 9 ++------- app/Models/PodcastModel.php | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/Entities/Episode.php b/app/Entities/Episode.php index e16fc81c..bb45c773 100644 --- a/app/Entities/Episode.php +++ b/app/Entities/Episode.php @@ -598,7 +598,7 @@ class Episode extends Entity helper('rss'); $xmlNode = (new SimpleRSSElement( - '', + '', )) ->addChild('channel') ->addChild('item'); @@ -622,7 +622,7 @@ class Episode extends Entity helper('rss'); $customXML = simplexml_load_string( - '' . + '' . $customRssString . '', ); diff --git a/app/Entities/Podcast.php b/app/Entities/Podcast.php index 3aff5e15..0ab77601 100644 --- a/app/Entities/Podcast.php +++ b/app/Entities/Podcast.php @@ -642,7 +642,7 @@ class Podcast extends Entity helper('rss'); $xmlNode = (new SimpleRSSElement( - '', + '', ))->addChild('channel'); array_to_rss([ 'elements' => $this->custom_rss, @@ -664,7 +664,7 @@ class Podcast extends Entity helper('rss'); $customRssArray = rss_to_array( simplexml_load_string( - '' . + '' . $customRssString . '', ), diff --git a/app/Helpers/rss_helper.php b/app/Helpers/rss_helper.php index 223c68f6..d3ee71aa 100644 --- a/app/Helpers/rss_helper.php +++ b/app/Helpers/rss_helper.php @@ -35,8 +35,7 @@ if (! function_exists('get_rss_feed')) { $itunesNamespace = 'http://www.itunes.com/dtds/podcast-1.0.dtd'; - $podcastNamespace = - 'https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md'; + $podcastNamespace = 'https://podcastindex.org/namespace/1.0'; $atomNamespace = 'http://www.w3.org/2005/Atom'; @@ -450,11 +449,7 @@ if (! function_exists('rss_to_array')) { */ function rss_to_array(SimpleXMLElement $rssNode): array { - $nameSpaces = [ - '', - 'http://www.itunes.com/dtds/podcast-1.0.dtd', - 'https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md', - ]; + $nameSpaces = ['', 'http://www.itunes.com/dtds/podcast-1.0.dtd', 'https://podcastindex.org/namespace/1.0']; $arrayNode = []; $arrayNode['name'] = $rssNode->getName(); $arrayNode['namespace'] = $rssNode->getNamespaces(false); diff --git a/app/Models/PodcastModel.php b/app/Models/PodcastModel.php index a49a0ab0..3efef73b 100644 --- a/app/Models/PodcastModel.php +++ b/app/Models/PodcastModel.php @@ -500,7 +500,7 @@ class PodcastModel extends Model * @param mixed[] $data * * Sets the UUIDv5 for a podcast. For more information, see - * https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#guid + * https://podcastindex.org/namespace/1.0#guid * * @return mixed[] */