Stop calling RequestHandler::inRescueMode()
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 27 May 2022 13:10:40 +0000 (15:10 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 27 May 2022 13:14:55 +0000 (15:14 +0200)
wcfsetup/install/files/lib/acp/form/LoginForm.class.php
wcfsetup/install/files/lib/system/request/LinkHandler.class.php

index 83a78b383d0231404a01418a30f8da4a500d8f54..2aa01256f9f56a5a991964d2c3cd617c9abfc029 100755 (executable)
@@ -13,7 +13,6 @@ use wcf\system\exception\NamedUserException;
 use wcf\system\exception\UserInputException;
 use wcf\system\request\LinkHandler;
 use wcf\system\request\RequestHandler;
-use wcf\system\request\RouteHandler;
 use wcf\system\user\authentication\EmailUserAuthentication;
 use wcf\system\user\authentication\event\UserLoggedIn;
 use wcf\system\user\authentication\UserAuthenticationFactory;
@@ -252,12 +251,8 @@ class LoginForm extends AbstractCaptchaForm
         if (!empty($this->url)) {
             HeaderUtil::redirect($this->url);
         } else {
-            if (RequestHandler::getInstance()->inRescueMode()) {
-                $path = RouteHandler::getHost() . RouteHandler::getPath();
-            } else {
-                $application = ApplicationHandler::getInstance()->getActiveApplication();
-                $path = $application->getPageURL() . 'acp/';
-            }
+            $application = ApplicationHandler::getInstance()->getActiveApplication();
+            $path = $application->getPageURL() . 'acp/';
 
             HeaderUtil::redirect($path);
         }
index 6b78b7e0c8a1e3211f467a31159b908b4e161d01..a12c8640e2a47a465cd8607b82d8af3b779df92a 100644 (file)
@@ -250,17 +250,13 @@ class LinkHandler extends SingletonFactory
         if (!PACKAGE_ID) {
             $url = RouteHandler::getHost() . RouteHandler::getPath(['acp']) . ($isACP ? 'acp/' : '') . $url;
         } else {
-            if (RequestHandler::getInstance()->inRescueMode()) {
-                $pageURL = RouteHandler::getHost() . \str_replace('//', '/', RouteHandler::getPath(['acp']));
-            } else {
-                $application = ApplicationHandler::getInstance()->getApplication($abbreviation);
-                if ($application === null) {
-                    throw new \InvalidArgumentException("Unknown application identifier '{$abbreviation}'.");
-                }
-
-                $pageURL = $application->getPageURL();
+            $application = ApplicationHandler::getInstance()->getApplication($abbreviation);
+            if ($application === null) {
+                throw new \InvalidArgumentException("Unknown application identifier '{$abbreviation}'.");
             }
 
+            $pageURL = $application->getPageURL();
+
             $url = $pageURL . ($isACP ? 'acp/' : '') . $url;
         }