diff --git a/feed.php b/feed.php index 5bf1d2e85d8bfe5d7dda3e2ea88228f48c2f4fe3..6052e7cc645229da9abc23b2bad6e95213ec26a1 100644 --- a/feed.php +++ b/feed.php @@ -15,6 +15,12 @@ require_once(DOKU_INC.'inc/init.php'); //close session session_write_close(); +//feed disabled? +if(!actionOK('rss')) { + echo '<error>RSS feed is disabled.</error>'; + exit; +} + // get params $opt = rss_parseOptions(); diff --git a/inc/template.php b/inc/template.php index 8bd3234cc1144afd144f0ef7add4e4a59465f73f..a3808aa81dfb3ba160f4b42e1b9ec4b15e07c924 100644 --- a/inc/template.php +++ b/inc/template.php @@ -318,15 +318,17 @@ function tpl_metaheaders($alt = true) { } if($alt) { - $head['link'][] = array( - 'rel' => 'alternate', 'type'=> 'application/rss+xml', - 'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php' - ); - $head['link'][] = array( - 'rel' => 'alternate', 'type'=> 'application/rss+xml', - 'title'=> $lang['currentns'], - 'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace'] - ); + if(actionOK('rss')) { + $head['link'][] = array( + 'rel' => 'alternate', 'type'=> 'application/rss+xml', + 'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php' + ); + $head['link'][] = array( + 'rel' => 'alternate', 'type'=> 'application/rss+xml', + 'title'=> $lang['currentns'], + 'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace'] + ); + } if(($ACT == 'show' || $ACT == 'search') && $INFO['writable']) { $head['link'][] = array( 'rel' => 'edit', @@ -335,7 +337,7 @@ function tpl_metaheaders($alt = true) { ); } - if($ACT == 'search') { + if(actionOK('rss') && $ACT == 'search') { $head['link'][] = array( 'rel' => 'alternate', 'type'=> 'application/rss+xml', 'title'=> $lang['searchresult'],