Remove the `$_REQUEST['styleID']` handling
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 12 May 2022 10:29:34 +0000 (12:29 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 12 May 2022 10:35:44 +0000 (12:35 +0200)
Resolves #4533

wcfsetup/install/files/lib/system/WCF.class.php

index f8da53a2dfff6d39912b680d450989b74067189f..1189866f3cf3af2b301a16f8afccbb5d30d21892 100644 (file)
@@ -9,7 +9,6 @@ use wcf\data\package\PackageCache;
 use wcf\data\package\PackageEditor;
 use wcf\data\page\Page;
 use wcf\data\page\PageCache;
-use wcf\data\style\StyleAction;
 use wcf\page\CmsPage;
 use wcf\system\application\ApplicationHandler;
 use wcf\system\application\IApplication;
@@ -24,9 +23,7 @@ use wcf\system\exception\ErrorException;
 use wcf\system\exception\IPrintableException;
 use wcf\system\exception\NamedUserException;
 use wcf\system\exception\ParentClassException;
-use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\SystemException;
-use wcf\system\exception\UserInputException;
 use wcf\system\language\LanguageFactory;
 use wcf\system\package\PackageInstallationDispatcher;
 use wcf\system\registry\RegistryHandler;
@@ -545,27 +542,10 @@ class WCF
      */
     protected function initStyle()
     {
-        $styleID = 0;
-
-        /** @deprecated The 'styleID' parameter is deprecated. */
-        if (isset($_REQUEST['styleID'])) {
-            $styleID = \intval($_REQUEST['styleID']);
-
-            try {
-                $action = new StyleAction([$styleID], 'changeStyle');
-                $action->validateAction();
-                $action->executeAction();
-            } catch (PermissionDeniedException | UserInputException $e) {
-                $styleID = 0;
-            }
-        }
-
-        if ($styleID === 0) {
-            if (self::getSession()->getUser()->userID) {
-                $styleID = self::getSession()->getUser()->styleID ?: 0;
-            } else {
-                $styleID = self::getSession()->getVar('styleID') ?: 0;
-            }
+        if (self::getSession()->getUser()->userID) {
+            $styleID = self::getSession()->getUser()->styleID ?: 0;
+        } else {
+            $styleID = self::getSession()->getVar('styleID') ?: 0;
         }
 
         $styleHandler = StyleHandler::getInstance();