From afd1dba7743f20e5c6569e1cbc3579539f38d55b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 11 Dec 2022 19:50:10 +0000 Subject: [PATCH 1/2] Issue 12338: Use redirect for "about" and "about/more" --- src/App.php | 4 ++++ static/routes.config.php | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App.php b/src/App.php index 0d4e8880d..d4120bcc2 100644 --- a/src/App.php +++ b/src/App.php @@ -717,6 +717,10 @@ class App $this->baseURL->redirect('search'); } + if (in_array($moduleName, ['about', 'about/more'])) { + $this->baseURL->redirect('friendica'); + } + // Initialize module that can set the current theme in the init() method, either directly or via App->setProfileOwner $page['page_title'] = $moduleName; diff --git a/static/routes.config.php b/static/routes.config.php index e3c87f150..f33cd9581 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -318,8 +318,6 @@ return [ '/proofs' => [Module\Api\Mastodon\Proofs::class, [R::GET ]], // Dummy, not supported ], - '/about[/more]' => [Module\Friendica::class, [R::GET]], - '/admin' => [ '[/]' => [Module\Admin\Summary::class, [R::GET]], From 7dfe517c77c3f2499b7340ace74cb623c6263824 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 12 Dec 2022 11:24:20 +0000 Subject: [PATCH 2/2] Redirect in a different way --- src/App.php | 4 ---- src/Module/About.php | 35 +++++++++++++++++++++++++++++++++++ static/routes.config.php | 2 ++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 src/Module/About.php diff --git a/src/App.php b/src/App.php index d4120bcc2..0d4e8880d 100644 --- a/src/App.php +++ b/src/App.php @@ -717,10 +717,6 @@ class App $this->baseURL->redirect('search'); } - if (in_array($moduleName, ['about', 'about/more'])) { - $this->baseURL->redirect('friendica'); - } - // Initialize module that can set the current theme in the init() method, either directly or via App->setProfileOwner $page['page_title'] = $moduleName; diff --git a/src/Module/About.php b/src/Module/About.php new file mode 100644 index 000000000..dd58450fb --- /dev/null +++ b/src/Module/About.php @@ -0,0 +1,35 @@ +. + * + */ + +namespace Friendica\Module; + +use Friendica\BaseModule; + +/** + * Redirect to the friendica page + */ +class About extends BaseModule +{ + protected function rawContent(array $request = []) + { + $this->baseUrl->redirect('friendica'); + } +} diff --git a/static/routes.config.php b/static/routes.config.php index f33cd9581..70d230c2a 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -318,6 +318,8 @@ return [ '/proofs' => [Module\Api\Mastodon\Proofs::class, [R::GET ]], // Dummy, not supported ], + '/about[/more]' => [Module\About::class, [R::GET]], + '/admin' => [ '[/]' => [Module\Admin\Summary::class, [R::GET]],