Projects ⇒ Bugs ⇒ #656: RSS Blocks and apos Entity ⇒ CPG Dragonfly™ CMS
Bug #656 RSS Blocks and apos Entity
Project: Dragonfly 9.0.3 -> 9.3 Category: Blocks
Submitted: Monday, October 31, 2005 (19:51:04) Modified: Thursday, November 03, 2005 (01:10:22)
Status: Closed Assigned to: akamu
PHP Version: 4.4 HTTPD Server: Apache 2.0

View/Vote Add Comment

by: darkgrue
Description:
------------
This is a reoccurance of Bug #394.

RSS feeds can (and do) include the named character reference "'", which many HTML user agents (IE) do not accept (and shouldn't - that entity is NOT in the HTML 4 spec).

Although it is correct XML, it causes a lot of RSS feeds to look rather funny. As per the W3C recommendations http://www.w3.org/TR/xhtml1/#guidelines in Section C.16, they recommend substituting "'" for compatibility with HTML 4 user agents.

Reproduce code:
---------------
The fix made in v1.3 of html/includes/classes/rss.php (and carried forward) is incomplete, and does not have the intended effect.

Take the following RSS Feed:

[quote]<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Schneier on Security</title>
<link>http://www.schneier.com/blog/</link>
<description>A weblog covering security and security technology.</description>
<copyright>Copyright 2005 Bruce Schneier</copyright>
<lastBuildDate>Thu, 27 Oct 2005 13:10:09 -0600</lastBuildDate>
<generator>http://www.movabletype.org/?v=3.2</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>

<item>
<title>Australia&apos;s New Anti-Terrorism Legislation</title>
<description>There&apos;s a new Australian anti-terrorism law in the works. It includes such things as: 14-day secret detention without arrest by security services Shoot-to-kill &quot;on suspicion&quot; powers for police Imprisonment and fines for revealing an individual has been the subject of...</description>
<link>http://www.schneier.com/blog/archives/2005/10/australias_new.html</link>
<guid>http://www.schneier.com/blog/archives/2005/10/australias_new.html</guid>
<category></category>
<pubDate>Thu, 27 Oct 2005 13:10:09 -0600</pubDate>
</item>

</channel>
</rss>[quote]

Results in:

Australia&apos;s New Anti-Terrorism Legislation


This is the original proposed fix:

In file: "includes/functions/display.php", after Line 51 (before the line, "return $content;", add the lines:

// The named character reference &apos; (the apostrophe, U+0027)
// was introduced in XML 1.0 but does not appear in HTML. Authors
// should therefore use &#39; instead of &apos; to work as expected
// in HTML 4 user agents.
$content = $content = str_replace('&apos;', '&#039;', $content);
by: xfsunoles
that code look wrong cos there is 2 $content variable.

$content .= str_replace('&apos;', '&#039;', $content);
by: akamu
This bug has been fixed in the CVS.

Snapshots of the sources are packaged every 6 hours; this change
will be in the next snapshot. You can grab the snapshot at the
Downloads section.

Thank you for the report, and for helping us to make CPG-Nuke 9.0.3 -> 9.1 better.

cvs/html/includes/functions/display.php new revision: 9.30;
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español