summaryrefslogtreecommitdiff
path: root/utils/rss.php
diff options
context:
space:
mode:
authordeva <deva>2010-02-22 20:57:17 +0000
committerdeva <deva>2010-02-22 20:57:17 +0000
commit184bed72a9da81a4de621ef62ab7aab0c61c0ddf (patch)
treee266ddc88277eb0b347fe5b1c0700ea661294262 /utils/rss.php
parent3a08ef9c94e6f5c92a7f3885fb316b53d13cfd5c (diff)
Make rss feed generator atom 2.0 compliant.
Diffstat (limited to 'utils/rss.php')
-rw-r--r--utils/rss.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/rss.php b/utils/rss.php
index 6f909d3..bed69ce 100644
--- a/utils/rss.php
+++ b/utils/rss.php
@@ -56,9 +56,10 @@ class RSS {
$fp = fopen($this->rssfile, "w");
fwrite($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- fwrite($fp, "<rss version=\"2.0\">\n");
+ fwrite($fp, "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n");
fwrite($fp, " <channel>\n");
fwrite($fp, " <title>".$RSS_TITLE."</title>\n");
+ fwrite($fp, " <atom:link href=\"".$RSS_URL."/rss.xml\" rel=\"self\" type=\"application/rss+xml\" />\n");
fwrite($fp, " <link>".$RSS_URL."</link>\n");
fwrite($fp, " <description>".$RSS_DESCRIPTION."</description>\n");
fwrite($fp, " <language>en-us</language>\n");
@@ -74,7 +75,7 @@ class RSS {
fwrite($fp, " <item>\n");
fwrite($fp, " <title>".$newsentry->title."</title>\n");
fwrite($fp, " <link>".$RSS_URL."/?page=".$RSS_TARGET_PAGE."&amp;newsid=".$newsentry->time."</link>\n");
- $content = Markdown(htmlspecialchars_decode($newsentry->description));
+ $content = htmlspecialchars(Markdown(htmlspecialchars_decode($newsentry->description), true));
fwrite($fp, " <description>".$content."</description>\n");
fwrite($fp, " <pubDate>".$this->date($newsentry->time)."</pubDate>\n");
fwrite($fp, " <guid>".$RSS_URL."/?page=".$RSS_TARGET_PAGE."&amp;newsid=".$newsentry->time."</guid>\n");
@@ -101,7 +102,7 @@ class RSS {
$rssentry = new RSSEntry($param->getAttribute('title'),
$param->getAttribute('time'),
$param->getAttribute('category'),
- $param->getAttribute('description'));
+ $param->textContent);
$this->add($rssentry);
}