Ticket #1451 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

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

Reported by: sameerd Assigned to: leftjustified
Priority: low Milestone:
Component: Template Version: 1.5.2
Severity: normal Keywords: RSS XML special characters bg|has-patch
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

1451.patch (0.8 kB) - added by leftjustified on 07/15/06 15:12:23.
patch for 2.0 branch

Change History

07/05/06 08:35:31 changed by ptvguy

  • 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>

07/15/06 15:12:23 changed by leftjustified

  • attachment 1451.patch added.

patch for 2.0 branch

07/15/06 15:14:47 changed by leftjustified

  • keywords changed from RSS XML special characters to RSS XML special characters bg|has-patch.
  • owner changed from anonymous to leftjustified.
  • status changed from new to assigned.
  • component changed from Administration to Template.
  • severity changed from minor to normal.

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.

07/26/06 17:40:31 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

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

07/26/06 17:43:16 changed by ryan

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

11/30/06 19:41:50 changed by

  • milestone deleted.

Milestone 2.0.4 deleted