From: <al...@us...> - 2008-09-24 21:27:30
|
Revision: 693 http://sciret.svn.sourceforge.net/sciret/?rev=693&view=rev Author: alpeb Date: 2008-09-24 21:27:27 +0000 (Wed, 24 Sep 2008) Log Message: ----------- fixed entities issue Modified Paths: -------------- trunk/views/Rss.php Modified: trunk/views/Rss.php =================================================================== --- trunk/views/Rss.php 2008-09-24 20:58:11 UTC (rev 692) +++ trunk/views/Rss.php 2008-09-24 21:27:27 UTC (rev 693) @@ -19,6 +19,8 @@ public function dispatch() { + header('Content-Type: text/xml'); + $this->tpl->set_file('main', 'Rss.tpl'); $this->tpl->set_block('main', 'articles_block', 'articles'); @@ -55,12 +57,17 @@ $firstIteration = true; while ($article = $articles->fetch()) { unset($this->tPath); + + // use html_entity_decode(strip_tags()) for text nodes instead + // of just htmlspecialchars() because RSS only accepts a few HTML entities $this->tpl->set_var(array( 'art_link' => htmlspecialchars($article->isBookmark()? $article->getURL(true) : Library::getLink(array('view' => 'ViewArticle', 'id' => $article->getId()))), - 'art_title' => htmlspecialchars($article->getTitle()), + 'art_title' => strip_tags($article->getTitle()), 'art_date' => date('r', strtotime($article->getModifiedByUserId() > 0? $article->getModificationDate() : $article->getCreationDate())), - 'art_excerpt' => strip_tags($article->getExcerpt()).($article->isBookmark()? '' : '...'), - 'art_author' => htmlspecialchars($article->getCreatedBy()), + 'art_excerpt' => html_entity_decode(strip_tags($article->getExcerpt()).($article->isBookmark()? '' : '...'), + ENT_NOQUOTES, 'UTF-8'), + 'art_author' => html_entity_decode(strip_tags($article->getCreatedBy()), + ENT_NOQUOTES, 'UTF-8'), )); $this->tpl->parse('articles', 'articles_block', !$firstIteration); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |