Projects ⇒ Bugs ⇒ #394: RSS Blocks and apos Entity ⇒ CPG Dragonfly™ CMS
Bug #394 RSS Blocks and apos Entity
Project: Dragonfly 9.0.3 -> 9.3 Category: Blocks
Submitted: Tuesday, April 05, 2005 (23:02:31) Modified: Monday, October 31, 2005 (19:51:57)
Status: Closed Assigned to:
PHP Version: Irrelevant HTTPD Server: Apache 2.0
Votes: 1
Vote results:
Avg. Score: 5.0 ± 0.0 Reproduced: 1 of 1 (100.0%)
Same PHP Version: 1 (100.0%) Same HTTPD Server: 0 (0.0%)

View/Vote Add Comment

by: darkgrue
Description:
------------
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.

Fix provided.

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

// The named character reference ' (the apostrophe, U+0027)
// was introduced in XML 1.0 but does not appear in HTML. Authors
// should therefore use ' instead of ' to work as expected
// in HTML 4 user agents.
$content = $content = str_replace(''', ''', $content);
by: DJMaze
' is correct coding and is also functioning in RSS which is NOT HTML but XML.

So we should create a "work around" in our RSS reader to satisfy the old HTML 4.0 spec of IE ???
by: sarah
You are right and IE is wrong, but many users of Dragonfly have a lot of site members that are still using IE. If it doesn't hurt then why not?
by: DJMaze
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.

http://dragonflycms.com/cvs/html/includes/classes/rss.php
by: darkgrue
Bug has returned. The implementation of the fix in Version 1.4 includes/classes/rss.php doesn't seem to take in to account the entire problem, unfortunately.

Take the following RSS Feed (actually a cut-down version of the feed, I had to really massage it to get it to display like the source angle brackets and ampersands and suchlike):

<?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's New Anti-Terrorism Legislation</title>
<description>There'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 "on suspicion" 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>


results in the output:

Australia's New Anti-Terrorism Legislation
by: darkgrue
Grr, figures. What I meant to say (Projects really needs a Preview post) was:

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


produces:

Australia&apos;s New Anti-Terrorism Legislation
by: darkgrue
Bug #656 opened to track this. The Projects module is a little fussy about displaying bugs that have been reopened in the main listing...
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español