Skip to content

Commit 2d9d0f2

Browse files
committed
Do not allow bots to access the skeleton page
1 parent 5c9b20b commit 2d9d0f2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

controller/main.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use phpbb\config\config;
1717
use phpbb\controller\helper;
18+
use phpbb\exception\http_exception;
1819
use phpbb\request\request;
1920
use phpbb\skeleton\helper\packager;
2021
use phpbb\skeleton\helper\validator;
@@ -76,9 +77,15 @@ public function __construct(config $config, helper $helper, request $request, pa
7677
* Demo controller for route /skeleton
7778
*
7879
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
80+
* @throws http_exception
7981
*/
8082
public function handle()
8183
{
84+
if ($this->user->data['is_bot'])
85+
{
86+
throw new http_exception(403, 'NOT_AUTHORISED');
87+
}
88+
8289
if ($this->request->is_set_post('submit'))
8390
{
8491
try

0 commit comments

Comments
 (0)