Commit 6833dd05 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(rss): update podcast extension namespace

refs #360
parent 3747fa2c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -598,7 +598,7 @@ class Episode extends Entity
        helper('rss');

        $xmlNode = (new SimpleRSSElement(
            '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
            '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
        ))
            ->addChild('channel')
            ->addChild('item');
@@ -622,7 +622,7 @@ class Episode extends Entity
        helper('rss');

        $customXML = simplexml_load_string(
            '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><item>' .
            '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><item>' .
                $customRssString .
                '</item></channel></rss>',
        );
+2 −2
Original line number Diff line number Diff line
@@ -642,7 +642,7 @@ class Podcast extends Entity
        helper('rss');

        $xmlNode = (new SimpleRSSElement(
            '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
            '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
        ))->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(
                '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel>' .
                '<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel>' .
                    $customRssString .
                    '</channel></rss>',
            ),
+2 −7
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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[]
     */