Skip to content

Fix support for feeds with XML preample + DTD#914

Closed
Alkarex wants to merge 2 commits intosimplepie:masterfrom
FreshRSS:fix-xml-dtd
Closed

Fix support for feeds with XML preample + DTD#914
Alkarex wants to merge 2 commits intosimplepie:masterfrom
FreshRSS:fix-xml-dtd

Conversation

@Alkarex
Copy link
Contributor

@Alkarex Alkarex commented Apr 18, 2025

Simple feeds with XML preample + DTD are crashing (see example in test) due to regression from 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
Downstream PR: FreshRSS#35

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
@Alkarex
Copy link
Contributor Author

Alkarex commented Apr 18, 2025

Although the regression is old in SimplePie, this was not spotted before because we used a patched version of SimplePie that had (by choice) not incorporated those changes until FreshRSS 1.25.0 released in December.
FreshRSS/FreshRSS#4374

Alkarex added a commit to FreshRSS/simplepie that referenced this pull request Apr 18, 2025
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
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Apr 18, 2025
Alkarex added a commit to FreshRSS/FreshRSS that referenced this pull request Apr 18, 2025
Alkarex added a commit to FreshRSS/simplepie 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 to FreshRSS/simplepie 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 to FreshRSS/simplepie 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
Alkarex added a commit to FreshRSS/simplepie that referenced this pull request Jun 24, 2025
Upstream: simplepie#915

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

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
Copy link
Contributor Author

Alkarex commented Jun 24, 2025

Replaced by #915

@Alkarex Alkarex closed this Jun 24, 2025
@Alkarex Alkarex deleted the fix-xml-dtd branch June 24, 2025 06:38
jtojnar pushed a commit 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant