Repository navigation
Conversation
Nothing of that seems relevant anymore for PHP 7.4+
This was referenced Nov 18, 2026
Contributor
Author
Alkarex
added a commit
to FreshRSS/simplepie
that referenced
this pull request
Nov 19, 2026
https://wiki.php.net/rfc/domdocument_html5_parser https://wiki.php.net/rfc/opt_in_dom_spec_compliance Polyfill `Dom\` classes for PHP < 8.4. Needs PHPStan 2+: #97 Needed for fixing issues such as FreshRSS/FreshRSS#5201 Currently, SimplePie uses legacy DOMDocument parsing, which outputs potentially problematic HTML, not correctly sanitised. This breaks the assumption that one can use something like `<div><!-- some HTML sanitized from SimplePie --></div>`. ``` --- Expected +++ Actual @@ @@ '<ul> - <li><div></div></li> + <li><div> <li>Item</li> -</ul>' +</div></li></ul>' ``` When shown in a compliant Web browser, several tags will be wrongly closed, breaking the layout of the client. This PR patches SimplePie to use the modern parser and code syntax, while maintaining a best-effort polyfill for legacy PHP versions < 8.4. Downstream: * FreshRSS/FreshRSS#9567 Upstream: * simplepie#1021 * simplepie#1022 * simplepie#1023
Alkarex
added a commit
to FreshRSS/FreshRSS
that referenced
this pull request
Nov 19, 2026
Currently, SimplePie uses legacy DOMDocument parsing, which outputs potentially problematic HTML, not correctly sanitised.
This breaks the assumption that one can use something like `<div><!-- some HTML sanitized from SimplePie --></div>`.
```
--- Expected
+++ Actual
@@ @@
'<ul>
- <li><div></div></li>
+ <li><div>
<li>Item</li>
-</ul>'
+</div></li></ul>'
```
When shown in a compliant Web browser, several tags will be wrongly closed, breaking the layout of the client.
This PR patches SimplePie to use the modern parser and code syntax, while maintaining a best-effort polyfill for legacy PHP versions < 8.4.
Depends on:
SimplePie: Upgrade to PHPStan 2
* FreshRSS/simplepie#97
* simplepie/simplepie#939
* simplepie/simplepie#1019
SimplePie: Use PHP 8.4+ \Dom classes and functions
* FreshRSS/simplepie#98
* simplepie/simplepie#1021
SimplePie: Add unit test for HTML5 sanitizing compliance
* simplepie/simplepie#1022
SimplePie: Remove obsolete xml_is_sane and XMLReader fallback
* simplepie/simplepie#1023
CssXPath: Add support for case insensitivity
* phpgt/CssXPath#256
fix #5201
fix #6830
fix #6831
~5% faster for HTML sanitising.
Remove SimpleXML. Remove XMLReader.
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.
Nothing of that seems relevant anymore for PHP 7.4+