WordPress.org

Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#4321 closed defect (bug) (fixed)

Feed validation error with html in categories

Reported by: devil1591 Owned by: westi
Milestone: 2.7 Priority: low
Severity: minor Version: 2.2
Component: General Keywords: rss has-patch
Focuses: Cc:

Description

when I put a "&" in a category name, the feed fails validation on http://feedvalidator.org/

example:

line 46, column 41: category should not contain HTML: & [help]
<category><![CDATA[Form. &amp; Régl.]]></category>

Attachments (2)

4321.diff (644 bytes) - added by Nazgul 14 years ago.
4321-new.diff (656 bytes) - added by lildude 13 years ago.
This patch is against the 2.5.1 source

Download all attachments as: .zip

Change History (11)

#1 follow-up: @Otto42
14 years ago

That particular error is only a warning, not a feed breaker. It doesn't make it fail validation, just makes it give the warning.

#2 @rob1n
14 years ago

  • Milestone set to 2.3
  • Priority changed from normal to low
  • Severity changed from normal to minor

@Nazgul
14 years ago

#3 @Nazgul
14 years ago

  • Keywords has-patch added

Simple patch attached

#4 @foolswisdom
14 years ago

  • Keywords early added
  • Milestone changed from 2.3 to 2.4

#5 @westi
14 years ago

  • Keywords needs-patch added; has-patch removed
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

Nazguls patch does not fix the warning on the validator for me:

line 23, column 51: category should not contain HTML: &#38; [help]
<category><![CDATA[something&#38;somethingelse]]></category>

Should we be converting the &amp; back to & here?

#6 @Nazgul
13 years ago

  • Keywords early removed

@lildude
13 years ago

This patch is against the 2.5.1 source

#7 @lildude
13 years ago

  • Keywords has-patch added; needs-patch removed

The problem is the category name has had things like the ampersand converted into their HTML Entities. So to clear the warning, it should be sufficient to decode the $cat_name when producing the feed.

Attached patch (4321-new.diff) does exactly that and allows the feed to validate without any warnings.

#8 in reply to: ↑ 1 @lloydbudd
13 years ago

  • Milestone changed from 2.9 to 2.7

Replying to Otto42:

That particular error is only a warning, not a feed breaker. It doesn't make it fail validation, just makes it give the warning.

According to #7815, it appears this is a real issue in IE8. Seems like time to finally fix this.

#9 @matt
13 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [9148]) Don't encoded category element contents - fixes #4321 and #7815.

Note: See TracTickets for help on using tickets.