diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-18 13:19:05 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-18 13:19:05 +0100 |
commit | 54be1338e56b721dd24c049153eea295b6f386d5 (patch) | |
tree | e7f62caa810ca864c3204b1cd4491587978d65c6 | |
parent | 494cd513a6a384395f63bcdae7343254acc36e16 (diff) | |
download | rpg-54be1338e56b721dd24c049153eea295b6f386d5.tar.gz rpg-54be1338e56b721dd24c049153eea295b6f386d5.tar.bz2 |
allow disabling the rss feed
-rw-r--r-- | feed.php | 6 | ||||
-rw-r--r-- | inc/template.php | 22 |
2 files changed, 18 insertions, 10 deletions
@@ -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 8bd3234cc..a3808aa81 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'], |