Disabled unnecessary box handler initialization in acp
authorMarcel Werk <burntime@woltlab.com>
Sun, 6 Nov 2016 13:40:38 +0000 (14:40 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 6 Nov 2016 15:37:21 +0000 (16:37 +0100)
wcfsetup/install/files/lib/system/exception/NamedUserException.class.php
wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php

index 258ff7eb6a4965842449321351a0113a54cb88b2..18efbe6f16ecb82e7ca392c01bfdc9864085ebbd 100644 (file)
@@ -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([
index d2fe446972da8a93a8002a72d06084268dca762b..b8632c008c9cdd8ae19a469f348b0635360b3642 100644 (file)
@@ -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');