Fix support for feeds with XML preample + DTD#35
Merged
Conversation
Simple feeds with XML preample + DTD are crashing (see example in test) due to regression from simplepie@162a3d3 The culprit feature *added support for html entities in xml* seems to come from a misunderstanding of https://www.rssboard.org/rss-encoding-examples Example of feed: https://blog.plover.com/index.rss Downstream Issue: FreshRSS/FreshRSS#7514
This was referenced Apr 18, 2025
Frenzie
reviewed
Apr 18, 2025
| if ($declaration->parse()) { | ||
| $data = substr($data, $pos + 2); | ||
| $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' ."\n". $this->declare_html_entities() . $data; | ||
| $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . "\n" . $data; |
Member
There was a problem hiding this comment.
What's the point of overriding the XML declaration anyway? Some kind of encoding issues?
Frenzie
approved these changes
Apr 18, 2025
Alkarex
added a commit
to Alkarex/FreshRSS
that referenced
this pull request
Apr 18, 2025
Regression from FreshRSS#4374 fix: FreshRSS#7514 FreshRSS/simplepie#35 Upstream PR: simplepie/simplepie#914
Alkarex
added a commit
to FreshRSS/FreshRSS
that referenced
this pull request
Apr 18, 2025
Regression from #4374 fix: #7514 FreshRSS/simplepie#35 Upstream PR: simplepie/simplepie#914
Alkarex
added a commit
that referenced
this pull request
Jun 23, 2025
Alternative of simplepie#914 with support for XML feeds using HTML entities Simple feeds with XML preample + DTD are crashing (see example in test) due to regression from simplepie@162a3d3 Its implementation is buggy, as it creates a second DOCTYPE declaration even when there is an existing one, which is completely invalid. Example of feed: https://blog.plover.com/index.rss Downstream Issue: FreshRSS/FreshRSS#7514 Downstream PR: #35 Note that the culprit feature *added support for html entities in xml* seems to come from a misunderstanding of https://www.rssboard.org/rss-encoding-examples HTML entities are only allowed in XML when there is a DTD declaring them. SimplePie is even allowing Atom documents with undeclared HTML entities - which I am not sure is on purpose. Downstream issue: FreshRSS/FreshRSS#7687
Alkarex
added a commit
that referenced
this pull request
Jun 23, 2025
Alternative of simplepie#914 with support for XML feeds using HTML entities Simple feeds with XML preample + DTD are crashing (see example in test) due to regression from simplepie@162a3d3 Its implementation is buggy, as it creates a second DOCTYPE declaration even when there is an existing one, which is completely invalid. Example of feed: https://blog.plover.com/index.rss Downstream Issue: FreshRSS/FreshRSS#7514 Downstream PR: #35 Note that the culprit feature *added support for html entities in xml* seems to come from a misunderstanding of https://www.rssboard.org/rss-encoding-examples HTML entities are only allowed in XML when there is a DTD declaring them. SimplePie is even allowing Atom documents with undeclared HTML entities - which I am not sure is on purpose. Downstream issue: FreshRSS/FreshRSS#7687
Member
Author
|
Partial revert (allow HTML entities again) and new approach in #37 |
Alkarex
added a commit
that referenced
this pull request
Jun 24, 2025
* Fix support for feeds with XML preample + DTD, entities Alternative of simplepie#914 with support for XML feeds using HTML entities Simple feeds with XML preample + DTD are crashing (see example in test) due to regression from simplepie@162a3d3 Its implementation is buggy, as it creates a second DOCTYPE declaration even when there is an existing one, which is completely invalid. Example of feed: https://blog.plover.com/index.rss Downstream Issue: FreshRSS/FreshRSS#7514 Downstream PR: #35 Note that the culprit feature *added support for html entities in xml* seems to come from a misunderstanding of https://www.rssboard.org/rss-encoding-examples HTML entities are only allowed in XML when there is a DTD declaring them. SimplePie is even allowing Atom documents with undeclared HTML entities - which I am not sure is on purpose. Downstream issue: FreshRSS/FreshRSS#7687 * Fix merge error
jtojnar
pushed a commit
to simplepie/simplepie
that referenced
this pull request
Jun 29, 2025
Alternative of #914 with support for XML feeds using HTML entities Simple feeds with XML preamble + DOCTYPE are crashing (see example in test) due to regression from 162a3d3 Its implementation is buggy, as it creates a second DOCTYPE declaration even when there is an existing one, which is completely invalid. Example of feed: https://blog.plover.com/index.rss Downstream Issue: FreshRSS/FreshRSS#7514 Downstream PR: FreshRSS#35 Note that the culprit feature *added support for html entities in xml* seems to come from a misunderstanding of https://www.rssboard.org/rss-encoding-examples HTML entities are only allowed in XML when there is a DTD declaring them. SimplePie is even allowing Atom documents with undeclared HTML entities - which I am not sure is on purpose. Downstream issue: FreshRSS/FreshRSS#7687
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simple feeds with XML preample + DTD are crashing (see example in test) due to regression from simplepie@162a3d3
The culprit feature added support for html entities in xml seems to come from a misunderstanding of https://www.rssboard.org/rss-encoding-examples
And its implementation is buggy anyway, as it creates a second DOCTYPE declaration even when there is an existing one, which is completely invalid.
Example of feed: https://blog.plover.com/index.rss
Downstream Issue: FreshRSS/FreshRSS#7514
Upstream PR: simplepie#914