Use PSR-7 responses in LogoutAction
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 5 Aug 2021 08:40:00 +0000 (10:40 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 5 Aug 2021 10:01:49 +0000 (12:01 +0200)
wcfsetup/install/files/lib/acp/action/LogoutAction.class.php
wcfsetup/install/files/lib/action/LogoutAction.class.php

index 50afa676ae5a6bb6042df2b84d635de617ff962e..c5386cd5163cfbe308a3d167d867e1a683304e4a 100755 (executable)
@@ -2,10 +2,10 @@
 
 namespace wcf\acp\action;
 
+use Laminas\Diactoros\Response\RedirectResponse;
 use wcf\action\AbstractSecureAction;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
-use wcf\util\HeaderUtil;
 
 /**
  * Does the user logout in the admin control panel (clearing reauthentication).
@@ -33,10 +33,10 @@ class LogoutAction extends AbstractSecureAction
 
         $this->executed();
 
-        HeaderUtil::redirect(LinkHandler::getInstance()->getLink(null, [
-            'forceFrontend' => true,
-        ]));
-
-        exit;
+        return new RedirectResponse(
+            LinkHandler::getInstance()->getLink(null, [
+                'forceFrontend' => true,
+            ])
+        );
     }
 }
index 690dc9f8766d83abaa7f5b665eda4ea78cd01bdb..9b06b5782449ea04c55a584e1501129351bd280b 100644 (file)
@@ -2,9 +2,9 @@
 
 namespace wcf\action;
 
+use Laminas\Diactoros\Response\RedirectResponse;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
-use wcf\util\HeaderUtil;
 
 /**
  * Does the user logout.
@@ -29,9 +29,8 @@ class LogoutAction extends \wcf\acp\action\LogoutAction
 
         $this->executed();
 
-        // forward to index page
-        HeaderUtil::redirect(LinkHandler::getInstance()->getLink());
-
-        exit;
+        return new RedirectResponse(
+            LinkHandler::getInstance()->getLink()
+        );
     }
 }