From d1f9b6c23240c1528065c5590b25620bf6206e4c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 18 Apr 2025 14:59:46 +0200 Subject: SimplePie: Fix support for feeds with XML preample + DTD (#7515) Regression from https://github.com/FreshRSS/FreshRSS/pull/4374 fix: https://github.com/FreshRSS/FreshRSS/issues/7514 https://github.com/FreshRSS/simplepie/pull/35 Upstream PR: https://github.com/simplepie/simplepie/pull/914 --- lib/composer.json | 2 +- lib/simplepie/simplepie/src/Parser.php | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/composer.json b/lib/composer.json index 970f0a994..2251f4986 100644 --- a/lib/composer.json +++ b/lib/composer.json @@ -14,7 +14,7 @@ "marienfressinaud/lib_opml": "0.5.1", "phpgt/cssxpath": "v1.3.0", "phpmailer/phpmailer": "6.9.3", - "simplepie/simplepie": "dev-freshrss#d31582a14f027a3bb72079bbb52be788ed1c6f56" + "simplepie/simplepie": "dev-freshrss#2e668d7b1bc2787310b99d2fd59bfda96e31b6ae" }, "config": { "sort-packages": true, diff --git a/lib/simplepie/simplepie/src/Parser.php b/lib/simplepie/simplepie/src/Parser.php index c5f4ac575..d6bdadf07 100644 --- a/lib/simplepie/simplepie/src/Parser.php +++ b/lib/simplepie/simplepie/src/Parser.php @@ -111,7 +111,7 @@ class Parser implements RegistryAware $declaration = $this->registry->create(DeclarationParser::class, [substr($data, 5, $pos - 5)]); if ($declaration->parse()) { $data = substr($data, $pos + 2); - $data = 'version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' ."\n". $this->declare_html_entities() . $data; + $data = 'version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . "\n" . $data; } else { $this->error_string = 'SimplePie bug! Please report this!'; return false; @@ -643,13 +643,6 @@ class Parser implements RegistryAware $this->data = ['child' => ['' => ['rss' => $rss]]]; return true; } - - private function declare_html_entities(): string - { - // This is required because the RSS specification says that entity-encoded - // html is allowed, but the xml specification says they must be declared. - return ' ]>'; - } } class_alias('SimplePie\Parser', 'SimplePie_Parser'); -- cgit v1.2.3