Page MenuHomePhabricator

Atom feed doesn't specify namespace for feed element
Closed, ResolvedPublic

Description

Author: myk

Description:
The Atom version of the Special:Recentchanges page doesn't specify a namespace
for the feed element. It generates the following feed tag:

<feed version="0.3" xml:lang="en">

Whereas it should generate the following tag:

<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en">

... per the Atom 0.3 spec:
http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html

Because of this bug, feed validators like feedvalidator.org say the feed is invalid:

http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwiki.mozilla.org%2Findex.php%3Ftitle%3DSpecial%3ARecentchanges%26feed%3Datom

More importantly, some feed readers don't see the feed as an Atom feed, so they
don't parse it correctly.


Version: 1.5.x
Severity: normal

Details

Reference
bz3933

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:53 PM
bzimport set Reference to bz3933.
bzimport added a subscriber: Unknown Object (MLST).

myk wrote:

patch v1: fixes bug in Feed.php

This one-liner adds the necessary namespace attribute. Note that I've applied
this patch to wiki.mozilla.org, so the feedvalidator URL above won't show the
error anymore. But other wiki sites, like wikitravel, do show the error.
Here's what the feed validator says about wikitravel:

http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwikitravel.org%2Fwiki%2Fen%2Findex.php%3Ftitle%3DSpecial%3ARecentchanges%26feed%3Datom

attachment bug-3933.diff ignored as obsolete

myk wrote:

patch v2: updated to 1.5 release branch

The previous patch was against our 1.4 installation, and it doesn't apply
cleanly to 1.5. This patch does. Note that neither patch is necessary on the
trunk, as the trunk is using Atom 1.0, and its feed tag is labeled with the
appropriate namespace attribute.

Attached:

Applied to REL1.5, will be in 1.5.3.