Make WordPress Core

Opened 13 years ago

Closed 9 years ago

#14224 closed defect (bug) (worksforme)

Use NCR instead of HTML entity in feed autodiscovery links

Reported by: peaceablewhale's profile peaceablewhale Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Feeds Keywords: has-patch 2nd-opinion
Focuses: template Cc:


Currently, » is used as the separator. This will break sites served with the internet media type "application/xhtml+xml". The equivalent numeric character reference » should be used instead.

Attachments (2)

14224.patch (1.0 KB) - added by peaceablewhale 13 years ago.
14224-ent2ncr.patch (1.1 KB) - added by peaceablewhale 13 years ago.

Download all attachments as: .zip

Change History (11)

#1 @westi
13 years ago

Why does this break the page when serving as XHTML?

AFAIK XHTML supports the same named entities as HTML4 which would inclide &raquo'.

Changing this makes it less clear what it being done.

#2 @nacin
13 years ago

application/xhtml+xml != XHTML. See also #14225, #14226.

#3 @westi
13 years ago

In general we don't code for serving as application/xhtml+xml but rather as text/html

As far as entities are concerned the named entities are fine in XML as long as the parser used can cope with them:

#4 @peaceablewhale
13 years ago

The XHTML 1.x specification did adopt all entities from HTML 4 and place them in the DTDs. However, browsers and most XML processors currently do not load DTD (at least by default) and therefore the entity references cannot be loaded properly and fatal error occurs.

In addition, HTML 5 does not provide a DTD nor require browsers to load a DTD. The HTML/XHTML Compatibility Authoring Guidelines stated that no entity reference is used.

A XHTML document should be served as application/xhtml+xml. By doing so, SVG and MathML can be embedded to the XHTML document inline. Internet Explorer 9 has support to application/xhtml+xml.

#5 @peaceablewhale
13 years ago

If using NRC directly makes the code less clear, ent2ncr() may be used for the conversion.

#6 @nacin
13 years ago

  • Milestone changed from Awaiting Review to Future Release

#7 @nacin
13 years ago

  • Keywords 2nd-opinion added

#8 @holizz
12 years ago

  • Cc tom@… added

#9 @nacin
9 years ago

  • Component changed from Template to Feeds
  • Focuses template added
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Do we still care about this? Please re-open if so.

Note: See TracTickets for help on using tickets.