Skip to content

Parser: treat https Atom 1.0 namespace as Atom - #1010

Merged
jtojnar merged 3 commits into
simplepie:masterfrom
jgalea:issue-746-atom-https-namespace
Oct 30, 2026
Merged

jtojnar merged 3 commits into
simplepie:masterfrom
jgalea:issue-746-atom-https-namespace

Conversation

@jgalea

@jgalea jgalea commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

This PR makes feeds that declare xmlns="https://www.w3.org/2005/Atom" parse as Atom 1.0. Fixes #746.

It follows the "map multiple known URIs to the same namespace" option from the discussion, the same way the Media RSS namespace variants are already normalised in Parser::split_ns(). A new NAMESPACE_ATOM_10_WRONG constant holds the https form. Feeds with the correct namespace are unaffected. A live example is ele-king.net/atom.xml: master reports that no feed could be found, and with this change it parses, 15 items when I checked.

This changes default behaviour in one more case: the normalisation applies to any element in the https namespace, not only the root. An RSS 2.0 feed that declares xmlns:atom="https://www.w3.org/2005/Atom" now exposes its atom:link elements, so get_link(0, 'self') and get_link(0, 'hub') return the self and hub URLs where master returns null. I checked this with a small RSS feed against master and the branch.

The new test in SimplePieTest parses an Atom feed with the https namespace and fails on master.

It would be good to have a maintainer's view on whether SimplePie should accept the https form at all, and whether a constant is the preferred way to express it.

@jtojnar jtojnar added this to the 1.10.0 milestone Oct 29, 2026

@jtojnar jtojnar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Comment thread src/SimplePie.php Resolved
Comment thread CHANGELOG.md Resolved
@jtojnar

jtojnar commented Oct 30, 2026

Copy link
Copy Markdown
Member

It would be good to have a maintainer's view on whether SimplePie should accept the https form at all

I think yes. IMO, the purpose of SimplePie is to provide an abstraction representing all things feed, guided by Postel’s law.

What it should not do is be a HTTP client or a sanitizer since other projects already do this much better. But since we care about backwards compatibility, we cannot just drop those parts.

@jtojnar
jtojnar merged commit fb16c5c into simplepie:master Oct 30, 2026
11 checks passed
Alkarex added a commit to FreshRSS/FreshRSS that referenced this pull request Nov 14, 2026
In particular:
* File,Psr18Client: Remove support for local files simplepie/simplepie#994
* Parser: ignore whitespace before the XML declaration simplepie/simplepie#1005
* Require PHP 7.4 or newer simplepie/simplepie#1006, simplepie/simplepie#992
* Parser: treat https Atom 1.0 namespace as Atom simplepie/simplepie#1010
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.

[ENH] make parsing more tolerant by allowing to specify https:// namespaces

2 participants