diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/app.php | 7 | ||||
-rw-r--r-- | phpBB/includes/event/kernel_exception_subscriber.php | 9 |
2 files changed, 8 insertions, 8 deletions
diff --git a/phpBB/app.php b/phpBB/app.php index c085f966c8..d93208d585 100644 --- a/phpBB/app.php +++ b/phpBB/app.php @@ -24,12 +24,7 @@ $user->session_begin(); $auth->acl($user->data); $user->setup('app'); -// Until we fix the issue with relative paths, we have to fake path info to -// allow urls like app.php?controller=foo/bar -$controller = $request->variable('controller', ''); -$uri = '/' . $controller; -$symfony_request = phpbb_create_symfony_request($uri, $request); - +$symfony_request = phpbb_create_symfony_request($request); $http_kernel = $phpbb_container->get('http_kernel'); $response = $http_kernel->handle($symfony_request); $response->send(); diff --git a/phpBB/includes/event/kernel_exception_subscriber.php b/phpBB/includes/event/kernel_exception_subscriber.php index e2668d4560..e843df2e68 100644 --- a/phpBB/includes/event/kernel_exception_subscriber.php +++ b/phpBB/includes/event/kernel_exception_subscriber.php @@ -18,6 +18,7 @@ if (!defined('IN_PHPBB')) use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpFoundation\Response; class phpbb_event_kernel_exception_subscriber implements EventSubscriberInterface @@ -56,9 +57,11 @@ class phpbb_event_kernel_exception_subscriber implements EventSubscriberInterfac { page_header($this->user->lang('INFORMATION')); + $exception = $event->getException(); + $this->template->assign_vars(array( 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'), - 'MESSAGE_TEXT' => $event->getException()->getMessage(), + 'MESSAGE_TEXT' => $exception->getMessage(), )); $this->template->set_filenames(array( @@ -67,7 +70,9 @@ class phpbb_event_kernel_exception_subscriber implements EventSubscriberInterfac page_footer(true, false, false); - $response = new Response($this->template->assign_display('body'), 404); + + $status_code = $exception instanceof NotFoundHttpException ? $exception->getStatusCode() : 500; + $response = new Response($this->template->assign_display('body'), $status_code); $event->setResponse($response); } |