Merge branch 'master' of /home/git/platal into profile_edit
[platal.git] / include / wiki / engine.php
index b294af9..dfd587f 100644 (file)
@@ -33,9 +33,9 @@ $feed  = false;
 // Check user perms
 switch (Env::v('action')) {
   case 'rss': case 'atom': case 'sdf': case 'dc':
-    wiki_apply_feed_perms($perms['0']);  
+    wiki_apply_feed_perms($perms[0]);
     $feed = true;
-  case '': case 'search': 
+  case '': case 'search':
     break;
 
   case 'edit':
@@ -80,6 +80,8 @@ if (Env::v('action') || !$cache_exists) {
     require_once($globals->spoolroot.'/wiki/pmwiki.php');
 
     $wikiAll = ob_get_clean();
+    pl_clear_errors();
+
     // the pmwiki skin we are using (almost empty) has these keywords:
     $i = strpos($wikiAll, "<!--/HeaderText-->");
     $j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
@@ -90,6 +92,7 @@ $wiki_exists = file_exists(wiki_work_dir() . '/' . wiki_filename($n));
 if ($feed) {
     $wikiAll = str_replace('dc:contributor', 'author', $wikiAll);
     $wikiAll = preg_replace('!<author>.*?\..*?\.(\d{4})\|(.*?)</author>!u', '<author>$2 (X$1)</author>', $wikiAll);
+    $wikiAll = str_replace('<link>./', '<link>' . $globals->baseurl . '/' . $platal->ns, $wikiAll);
     echo $wikiAll;
     pl_clear_errors();
     exit;
@@ -132,7 +135,7 @@ if (!Env::v('action')) {
     $url = '/' . str_replace('.', '/', $n) . '?action=rss';
     if (S::logged()) {
         $url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash');
-    } 
+    }
     $page->setRssLink($n, $url);
 }