From 3cf10b4f1856c4620b7de5d3eafba5f9dcdf17b7 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 6 Nov 2016 14:40:38 +0100 Subject: [PATCH] Disabled unnecessary box handler initialization in acp --- .../files/lib/system/exception/NamedUserException.class.php | 5 ++++- .../lib/system/exception/PermissionDeniedException.class.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php b/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php index 258ff7eb6a..18efbe6f16 100644 --- a/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php +++ b/wcfsetup/install/files/lib/system/exception/NamedUserException.class.php @@ -3,6 +3,7 @@ namespace wcf\system\exception; use wcf\system\box\BoxHandler; use wcf\system\session\SessionHandler; use wcf\system\WCF; +use wcf\system\WCFACP; /** * NamedUserException shows a (well) styled page with the given error message. @@ -17,7 +18,9 @@ class NamedUserException extends UserException { * Shows a styled page with the given error message. */ public function show() { - BoxHandler::getInstance()->disablePageLayout(); + if (!class_exists(WCFACP::class, false)) { + BoxHandler::getInstance()->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 d2fe446972..b8632c008c 100644 --- a/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php +++ b/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php @@ -3,6 +3,7 @@ namespace wcf\system\exception; use wcf\system\box\BoxHandler; use wcf\system\session\SessionHandler; use wcf\system\WCF; +use wcf\system\WCFACP; /** * A PermissionDeniedException is thrown when a user has no permission to access @@ -25,7 +26,9 @@ class PermissionDeniedException extends UserException { * Prints a permission denied exception. */ public function show() { - BoxHandler::getInstance()->disablePageLayout(); + if (!class_exists(WCFACP::class, false)) { + BoxHandler::getInstance()->disablePageLayout(); + } SessionHandler::getInstance()->disableTracking(); @header('HTTP/1.0 403 Forbidden'); -- 2.20.1