diff --git a/app/Helpers/rss_helper.php b/app/Helpers/rss_helper.php
index 0a82031c..075112de 100644
--- a/app/Helpers/rss_helper.php
+++ b/app/Helpers/rss_helper.php
@@ -30,13 +30,15 @@ if (! function_exists('get_rss_feed')) {
$podcastNamespace =
'https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md';
+ $atomNamespace = 'http://www.w3.org/2005/Atom';
+
$rss = new SimpleRSSElement(
- "",
+ ""
);
$channel = $rss->addChild('channel');
- $atomLink = $channel->addChild('atom:link', null, 'http://www.w3.org/2005/Atom');
+ $atomLink = $channel->addChild('link', null, $atomNamespace);
$atomLink->addAttribute('href', $podcast->feed_url);
$atomLink->addAttribute('rel', 'self');
$atomLink->addAttribute('type', 'application/rss+xml');
@@ -45,7 +47,7 @@ if (! function_exists('get_rss_feed')) {
$websubHubs = config('WebSub')
->hubs;
foreach ($websubHubs as $websubHub) {
- $atomLinkHub = $channel->addChild('atom:link', null, 'http://www.w3.org/2005/Atom');
+ $atomLinkHub = $channel->addChild('link', null, $atomNamespace);
$atomLinkHub->addAttribute('href', $websubHub);
$atomLinkHub->addAttribute('rel', 'hub');
$atomLinkHub->addAttribute('type', 'application/rss+xml');
@@ -411,7 +413,7 @@ if (! function_exists('add_category_tag')) {
{
$itunesNamespace = 'http://www.itunes.com/dtds/podcast-1.0.dtd';
- $itunesCategory = $node->addChild('category', '', $itunesNamespace);
+ $itunesCategory = $node->addChild('category', null, $itunesNamespace);
$itunesCategory->addAttribute(
'text',
$category->parent !== null
@@ -420,7 +422,7 @@ if (! function_exists('add_category_tag')) {
);
if ($category->parent !== null) {
- $itunesCategoryChild = $itunesCategory->addChild('category', '', $itunesNamespace);
+ $itunesCategoryChild = $itunesCategory->addChild('category', null, $itunesNamespace);
$itunesCategoryChild->addAttribute('text', $category->apple_category);
$node->addChild('category', $category->parent->apple_category);
}
diff --git a/app/Libraries/SimpleRSSElement.php b/app/Libraries/SimpleRSSElement.php
index 5df1f979..b1bebe7c 100644
--- a/app/Libraries/SimpleRSSElement.php
+++ b/app/Libraries/SimpleRSSElement.php
@@ -26,7 +26,7 @@ class SimpleRSSElement extends SimpleXMLElement
*/
public function addChildWithCDATA(string $name, string $value = '', ?string $namespace = null): static
{
- $newChild = parent::addChild($name, '', $namespace);
+ $newChild = parent::addChild($name, null, $namespace);
if ($newChild !== null) {
$node = dom_import_simplexml($newChild);
@@ -54,7 +54,7 @@ class SimpleRSSElement extends SimpleXMLElement
*/
public function addChild($name, $value = null, $namespace = null, $escape = true): static
{
- $newChild = parent::addChild($name, '', $namespace);
+ $newChild = parent::addChild($name, null, $namespace);
if ($newChild !== null) {
$node = dom_import_simplexml($newChild);
@@ -69,8 +69,7 @@ class SimpleRSSElement extends SimpleXMLElement
return $newChild;
}
- /** @noRector RecastingRemovalRector */
- $node->appendChild($no->createTextNode((string) $value));
+ $node->appendChild($no->createTextNode($value));
}
}