Skip to content

Commit

Permalink
Still tweaking rss feed validation
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Mar 15, 2012
1 parent 9e6ae5c commit 23ff420
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
22 changes: 12 additions & 10 deletions external/feedcreator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -891,18 +891,18 @@ function createFeed() {
$feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
/** $feed.= $this->_createGeneratorComment(); */
$feed.= $this->_createStylesheetReferences();
$feed.= "<rss version=\"".$this->RSSVersion."\"\n";
$feed.= "<rss version=\"".$this->RSSVersion."\" ";
if (!empty($this->XMLNS)) {
foreach ($this->XMLNS as $xmlns) {
$feed.= " xmlns:".$xmlns."\n";
}
}
$feed.= ' xmlns:content="http://purl.org/rss/1.0/modules/content/"'."\n";
$feed.= ' xmlns:wfw="http://wellformedweb.org/CommentAPI/"'."\n";
$feed.= ' xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
$feed.= ' xmlns:atom="http://www.w3.org/2005/Atom"'."\n";
$feed.= ' xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"'."\n";
$feed.= ' xmlns:slash="http://purl.org/rss/1.0/modules/slash/"'."\n";
$feed.= 'xmlns:content="http://purl.org/rss/1.0/modules/content/" ' ;
$feed.= 'xmlns:wfw="http://wellformedweb.org/CommentAPI/" ' ;
$feed.= 'xmlns:dc="http://purl.org/dc/elements/1.1/" ' ;
$feed.= 'xmlns:atom="http://www.w3.org/2005/Atom" ' ;
$feed.= 'xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" ' ;
$feed.= 'xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ' ;
$feed.= ">\n";
$feed.= " <channel>\n";
$feed.= " <title>".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."</title>\n";
Expand Down Expand Up @@ -1081,7 +1081,7 @@ function createFeed() {
$feed.= " </item>\n";
}
$feed.= " </channel>\n";
$feed.= "</rss>\n";
$feed.= "</rss>";
return $feed;
}
}
Expand All @@ -1097,6 +1097,7 @@ class RSSCreator20 extends RSSCreator091 {

function RSSCreator20() {
parent::_setRSSVersion("2.0");
$this->encoding = "utf-8";
}

}
Expand All @@ -1110,8 +1111,9 @@ function RSSCreator20() {
*/
class PodcastCreator extends RSSCreator20 {
function PodcastCreator() {
parent::_setRSSVersion("2.0");
parent::_setXMLNS("itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\"");
parent::_setRSSVersion("2.0");
$this->encoding = "utf-8";
parent::_setXMLNS("itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\"");
}
}

Expand Down
1 change: 0 additions & 1 deletion framework/core/controllers/expController.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ function getRSSContent() {
$rss_item->description = expString::convertSmartQuotes($item->body);
$rss_item->date = isset($item->publish_date) ? date('r',$item->publish_date) : date('r', $item->created_at);
$rss_item->link = makeLink(array('controller'=>$this->classname, 'action'=>'show', 'title'=>$item->sef_url));
$rss_item->guid = expUnserialize($item->location_data)->src.'-id#'.$item->id;
if (!empty($item->expCat[0]->title)) $rss_item->category = array($item->expCat[0]->title);
$comment_count = expCommentController::findComments(array('content_id'=>$item->id,'content_type'=>$this->basemodel_name));
if ($comment_count) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ function getRSSContent() {
$rss_item->description = expString::convertSmartQuotes($item->body);
$rss_item->date = isset($item->publish_date) ? date('r',$item->publish_date) : date('r', $item->created_at);
$rss_item->link = makeLink(array('controller'=>$this->classname, 'action'=>'show', 'title'=>$item->sef_url));
$rss_item->guid = expUnserialize($item->location_data)->src.'-id#'.$item->id;
if (!empty($item->expCat[0]->title)) $rss_item->category = array($item->expCat[0]->title);

// Add the attachment/enclosure info
Expand Down
1 change: 0 additions & 1 deletion framework/modules/news/controllers/newsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public function getRSSContent() {
$rss_item->description = $item->body;
$rss_item->date = date('r',$item->publish_date);
$rss_item->link = makeLink(array('controller'=>'news', 'action'=>'showByTitle', 'title'=>$item->sef_url));
$rss_item->guid = expUnserialize($item->location_data)->src.'-id#'.$item->id;
$rssitems[$key] = $rss_item;
}
return $rssitems;
Expand Down
1 change: 0 additions & 1 deletion site_rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

if ($site_rss->enable_rss == true) {
$rss = new UniversalFeedCreator();
$rss->encoding = LANG_CHARSET;
$rss->cssStyleSheet = "";
// $rss->useCached("PODCAST");
$rss->useCached();
Expand Down

0 comments on commit 23ff420

Please sign in to comment.