From 7c7ff31cd6adc94492af5cf919fc538bdff2060d Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Fri, 19 Apr 2019 15:29:00 -0600 Subject: [PATCH] Return 404 when attempting to access /error directly in production Replaces #2212 --- modules/cms/classes/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index c82156745..cf45cdb30 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -203,7 +203,7 @@ class Controller /* * If the page was not found, render the 404 page - either provided by the theme or the built-in one. */ - if (!$page || $url === '404') { + if (!$page || $url === '404' || ($url === 'error' && !Config::get('app.debug', false))) { if (!Request::ajax()) { $this->setStatusCode(404); }