Fixed some routing oversights.

This commit is contained in:
flash 2023-07-15 17:45:39 +00:00
parent 472fc0decc
commit 6274f7f8d3

View file

@ -211,7 +211,7 @@ class MisuzuContext {
$response->redirect($location, true);
});
$this->router->get('/news/index.php', function($response) {
$this->router->get('/news/index.php', function($response, $request) {
$response->redirect(url('news-index', [
'page' => $request->getParam('page', FILTER_SANITIZE_NUMBER_INT),
]), true);
@ -235,21 +235,23 @@ class MisuzuContext {
});
$this->router->get('/news/feed.php/rss', function($response, $request) {
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
$response->redirect(url(
$catId > 0 ? 'news-category-feed-rss' : 'news-feed-rss',
['category' => $request->getParam('c', FILTER_SANITIZE_NUMBER_INT)]
['category' => $catId]
), true);
});
$this->router->get('/news/feed.php/atom', function($response, $request) {
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
$response->redirect(url(
$catId > 0 ? 'news-category-feed-atom' : 'news-feed-atom',
['category' => $request->getParam('c', FILTER_SANITIZE_NUMBER_INT)]
['category' => $catId]
), true);
});
$this->router->get('/user-assets.php', function($response, $request) {
return (new \Misuzu\Http\Handlers\AssetsHandler)->serveLegacy($response, $request);
return (new \Misuzu\Http\Handlers\AssetsHandler($this))->serveLegacy($response, $request);
});
}
}