From 54be1338e56b721dd24c049153eea295b6f386d5 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 18 Mar 2014 13:19:05 +0100 Subject: allow disabling the rss feed --- feed.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'feed.php') diff --git a/feed.php b/feed.php index 5bf1d2e85..6052e7cc6 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 'RSS feed is disabled.'; + exit; +} + // get params $opt = rss_parseOptions(); -- cgit v1.2.3 From b09b9f475dba5eb97b53387929b3830c852915ca Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 18 Mar 2014 14:02:01 +0100 Subject: add 404 status header to feed disabled --- feed.php | 1 + 1 file changed, 1 insertion(+) (limited to 'feed.php') diff --git a/feed.php b/feed.php index 6052e7cc6..c1a5f4503 100644 --- a/feed.php +++ b/feed.php @@ -17,6 +17,7 @@ session_write_close(); //feed disabled? if(!actionOK('rss')) { + http_status(404); echo 'RSS feed is disabled.'; exit; } -- cgit v1.2.3 From 6dcc1e8f85ee46b2c7ed76d422523be1e27941c5 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 20 Mar 2014 15:39:57 +0100 Subject: Improve encoding dir in rssListNamespace() --- feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'feed.php') diff --git a/feed.php b/feed.php index 5bf1d2e85..b0187476b 100644 --- a/feed.php +++ b/feed.php @@ -474,7 +474,7 @@ function rssListNamespace($opt) { global $conf; $ns = ':'.cleanID($opt['namespace']); - $ns = str_replace(':', '/', $ns); + $ns = utf8_encodeFN(str_replace(':', '/', $ns)); $data = array(); $search_opts = array( -- cgit v1.2.3 From 477e59988f5e90600b6fdcda7c055ab8ea001e03 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 20 Mar 2014 15:40:31 +0100 Subject: add date sort option for list mode of feed --- feed.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'feed.php') diff --git a/feed.php b/feed.php index b0187476b..2ed2fce79 100644 --- a/feed.php +++ b/feed.php @@ -120,6 +120,8 @@ function rss_parseOptions() { 'items' => array('int', 'num', $conf['recent']), // Boolean, only used in rc mode 'show_minor' => array('bool', 'minor', false), + // String, only used in list mode + 'sort' => array('str', 'sort', 'natural'), // String, only used in search mode 'search_query' => array('str', 'q', null), // One of: pages, media, both @@ -131,6 +133,7 @@ function rss_parseOptions() { $opt['items'] = max(0, (int) $opt['items']); $opt['show_minor'] = (bool) $opt['show_minor']; + $opt['sort'] = valid_input_set('sort', array('default' => 'natural', 'date'), $opt); $opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none'); @@ -482,7 +485,7 @@ function rssListNamespace($opt) { 'pagesonly' => true, 'listfiles' => true ); - search($data, $conf['datadir'], 'search_universal', $search_opts, $ns); + search($data, $conf['datadir'], 'search_universal', $search_opts, $ns, $lvl = 1, $opt['sort']); return $data; } -- cgit v1.2.3 From d2704764cf26e4de50e48babaa675e8c45c6c1d6 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 30 Apr 2014 19:49:25 +0200 Subject: use new $INPUT->valid() method in feed.php --- feed.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'feed.php') diff --git a/feed.php b/feed.php index c1a5f4503..40f9af659 100644 --- a/feed.php +++ b/feed.php @@ -141,12 +141,10 @@ function rss_parseOptions() { $opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none'); - $type = valid_input_set( - 'type', array( - 'rss', 'rss2', 'atom', 'atom1', 'rss1', - 'default' => $conf['rss_type'] - ), - $_REQUEST + $type = $INPUT->valid( + 'type', + array( 'rss', 'rss2', 'atom', 'atom1', 'rss1'), + $conf['rss_type'] ); switch($type) { case 'rss': -- cgit v1.2.3 From 470bf4b293def91b822e2da17cb793912adc74b6 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 14 May 2014 20:58:35 +0200 Subject: username_link should show user's name in feed too --- feed.php | 1 + 1 file changed, 1 insertion(+) (limited to 'feed.php') diff --git a/feed.php b/feed.php index 40f9af659..996b1ba6b 100644 --- a/feed.php +++ b/feed.php @@ -405,6 +405,7 @@ function rss_buildItems(&$rss, &$data, $opt) { if($userInfo) { switch($conf['showuseras']) { case 'username': + case 'username_link': $item->author = $userInfo['name']; break; default: -- cgit v1.2.3