Make WordPress Core

Opened 19 years ago

Closed 18 years ago

Last modified 18 years ago

#1451 closed defect (bug) (fixed)

RSS feeds are not valid if there are special characters in the title

Reported by: sameerd's profile sameerd Owned by: leftjustified's profile leftjustified
Milestone: Priority: low
Severity: normal Version: 1.5.2
Component: Template Keywords: RSS XML special characters bg|has-patch
Focuses: Cc:

Description

If there are special characters in the Blog's title, they are not correctly escaped in the RSS feeds.

Test Case Example: http://test.dcostanet.net/wordpress/ The title has been set to

Test blog ; & ” ‘ ; < > ! special chars

In the RSS feed. http://test.dcostanet.net/wordpress/?feed=atom the title shows up as

<title>Test blog ; &#038; " ' ; < > ! special chars</title>

The special characters (double and single quote, and the inequality signs) need to be escaped. There is a similar problem with the other RSS feeds. http://test.dcostanet.net/wordpress/?feed=rss2

In the html part of the document http://test.dcostanet.net/wordpress/ the special characters are escaped correctly

<title>Test blog ; &#038; &#8221; &#8216; ; &lt; &gt; ! special chars </title>

This bug applies to version 1.5.1.2 (Trac reports it as 1.5.2) - a bug in trac maybe?

Attachments (1)

1451.patch (816 bytes) - added by leftjustified 18 years ago.
patch for 2.0 branch

Download all attachments as: .zip

Change History (6)

#1 @ptvguy
18 years ago

  • Milestone set to 2.0.4

Displays fine in 2.0.4, but still messed up on feed.

Goes out in ATOM as follows:

<title type="text/html" mode="escaped"><![CDATA[Test blog ; &#038; ” ‘ ; < > ! special chars]]></title>

and in RSS2, it causes this error:

XML Parsing Error: not well-formed
Location: http://localhost/wordpress/?feed=rss2
Line Number 17, Column 36:		<title>Test blog ; &#038; ” ‘ ; < > ! special chars</title>

due to this titling:

<title>Test blog ; &#038; ” ‘ ; < > ! special chars</title>

@leftjustified
18 years ago

patch for 2.0 branch

#2 @leftjustified
18 years ago

  • Component changed from Administration to Template
  • Keywords bg|has-patch added
  • Owner changed from anonymous to leftjustified
  • Severity changed from minor to normal
  • Status changed from new to assigned

I ran into this bug on 2.1svn while trying some other things. Simply adding an extra filter to the default-filters file fixes the problem in both 2.0 and 2.1 branches.

#3 @ryan
18 years ago

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

(In [4044]) specialchars feed titles. Props leftjustified. fixes #1451

#4 @ryan
18 years ago

(In [4046]) specialchars feed titles. Props leftjustified. fixes #1451

#5 @(none)
18 years ago

  • Milestone 2.0.4 deleted

Milestone 2.0.4 deleted

Note: See TracTickets for help on using tickets.