From 6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 27 Apr 2017 16:47:11 +0200 Subject: Router: Regular expressions for feed URLs has been combined. --- index.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 360bd4d..0697ed3 100644 --- a/index.php +++ b/index.php @@ -49,14 +49,7 @@ Router::add('', function() { #=============================================================================== # ROUTE: Feed #=============================================================================== -Router::add('feed/', function() { - require 'core/include/feed/main.php'; -}); - -#=============================================================================== -# ROUTE: Feed [item type only] -#=============================================================================== -Router::add('feed/(page|post)/', function($param) { +Router::add('feed/(?:(page|post)/)?', function($param = NULL) { require 'core/include/feed/main.php'; }); @@ -70,12 +63,7 @@ Router::add('search/', function() { #=============================================================================== # REDIRECT: Feed (trailing slash) #=============================================================================== -Router::addRedirect('feed', Application::getURL('feed/')); - -#=============================================================================== -# REDIRECT: Feed [posts or pages] (trailing slash) -#=============================================================================== -Router::addRedirect('feed/(page|post)', Application::getURL('feed/$1/')); +Router::addRedirect('feed(/(?:page|post))?', Application::getURL('feed$1/')); #=============================================================================== # REDIRECT: Search (trailing slash) -- cgit v1.2.3