From: Marcel Werk Date: Tue, 11 Oct 2016 16:10:34 +0000 (+0200) Subject: Error pages no longer load special box layouts X-Git-Tag: 3.0.0_Beta_3~50^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3cb5ef43bc32c549d4489a913475a04eae2fd57d;p=GitHub%2FWoltLab%2FWCF.git Error pages no longer load special box layouts Fixes #2115 --- diff --git a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php index d35fab4d2a..09320cebed 100644 --- a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php +++ b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php @@ -36,14 +36,21 @@ class BoxHandler extends SingletonFactory { */ protected $boxesByPosition = []; + /** + * @var bool + */ + protected $disablePageLayout = false; + /** * @inheritDoc */ protected function init() { // get active page id $pageID = 0; - if (($request = RequestHandler::getInstance()->getActiveRequest()) !== null) { - $pageID = $request->getPageID(); + if (!$this->disablePageLayout) { + if (($request = RequestHandler::getInstance()->getActiveRequest()) !== null) { + $pageID = $request->getPageID(); + } } // load box layout for active page @@ -192,4 +199,11 @@ class BoxHandler extends SingletonFactory { } } } + + /** + * Disables the loading of the box layout for the active page. + */ + public function disablePageLayout() { + $this->disablePageLayout = true; + } } diff --git a/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php b/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php index 473bac5a4e..258ff7eb6a 100644 --- a/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php +++ b/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php @@ -1,5 +1,6 @@ disablePageLayout(); SessionHandler::getInstance()->disableTracking(); WCF::getTPL()->assign([ diff --git a/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php b/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php index 555b55ae94..d2fe446972 100644 --- a/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php +++ b/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php @@ -1,5 +1,6 @@ disablePageLayout(); SessionHandler::getInstance()->disableTracking(); @header('HTTP/1.0 403 Forbidden');