nieuws/feed: canonical site references
[minimedit.git] / nieuws / feed / index.php
index 0a88cd4f3e06f2ea458d3aaa0d0ed826867f5a08..11138cea86cb37cbb233a80bfef401b22ac6c65c 100644 (file)
@@ -2,14 +2,14 @@
 ob_clean();
 header('Content-Type: application/atom+xml; charset=utf-8');
 print '<?xml version="1.0" encoding="utf-8"?>';
-$siteref = 'http://'.$_SERVER['HTTP_HOST'];
+$siteref = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'];
 ?>
 
 <feed xmlns="http://www.w3.org/2005/Atom">
        <title>Lijtweg.nl</title>
        <subtitle>Nieuwsberichten</subtitle>
-       <id><?= $siteref ?></id>
-       <link href="<?= $siteref ?>" />
+       <id><?= $siteref ?>/</id>
+       <link href="<?= $siteref ?>/" />
        <link href="<?= $siteref . $_SERVER['REQUEST_URI'] ?>" rel="self" />
        <author><name>Lijtweg</name></author>
 <?php
@@ -31,7 +31,8 @@ foreach ($pages as $i => $page) {
                <title><?= $article->title ?></title>
                <published><?= $article->dateiso ?></published>
                <updated><?= $article->dateiso ?></updated>
-               <content type="html"><?= htmlspecialchars($article->body) ?></content>
+               <content type="html"><?= htmlspecialchars($article->body) ?>
+               </content>
 <?php
        if ($article->thumb) {
                printf("\t\t".'<link rel="enclosure" type="%s" length="%d" href="%s" />'."\n",