diff --git a/feed.php b/feed.php index 996b1ba6ba41e4022a050ef8a57317948356cdd3..a63e22164649d2c84ea6973c7aa671164b818639 100644 --- a/feed.php +++ b/feed.php @@ -127,6 +127,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 @@ -138,6 +140,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'); @@ -480,7 +483,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( @@ -488,7 +491,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; }