WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#1451 closed defect (bug) (fixed)

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

Reported by: sameerd Owned by: 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 8 years ago.
patch for 2.0 branch

Download all attachments as: .zip

Change History (6)

comment:1 ptvguy8 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>

leftjustified8 years ago

patch for 2.0 branch

comment:2 leftjustified8 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.

comment:3 ryan8 years ago

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

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

comment:4 ryan8 years ago

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

comment:5 anonymous7 years ago

  • Milestone 2.0.4 deleted

Milestone 2.0.4 deleted

Note: See TracTickets for help on using tickets.