[!!!][TASK] Remove RDCT redirect functionality
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Classes / Hook / PreviewHook.php
index 2756189..b06dacc 100644 (file)
@@ -63,7 +63,6 @@ class PreviewHook implements \TYPO3\CMS\Core\SingletonInterface
      *
      * @param array $params (not needed right now)
      * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $pObj
-     * @return void
      */
     public function checkForPreview($params, &$pObj)
     {
@@ -82,8 +81,7 @@ class PreviewHook implements \TYPO3\CMS\Core\SingletonInterface
                 GeneralUtility::_GP('no_cache'),
                 GeneralUtility::_GP('cHash'),
                 null,
-                GeneralUtility::_GP('MP'),
-                GeneralUtility::_GP('RDCT')
+                GeneralUtility::_GP('MP')
             );
             $GLOBALS['TSFE'] = $this->tsfeObj;
             // Configuration after initialization of TSFE object.
@@ -102,7 +100,6 @@ class PreviewHook implements \TYPO3\CMS\Core\SingletonInterface
      *
      * @param array $params holding the BE_USER object
      * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $pObj
-     * @return void
      */
     public function initializePreviewUser(&$params, &$pObj)
     {
@@ -305,26 +302,24 @@ class PreviewHook implements \TYPO3\CMS\Core\SingletonInterface
                             setcookie($this->previewKey, GeneralUtility::_GP($this->previewKey), 0, GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'), null, null, true);
                         }
                         return $previewConfig;
-                    } elseif (GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'index.php?' . $this->previewKey . '=' . $inputCode === GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')) {
+                    }
+                    if (GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'index.php?' . $this->previewKey . '=' . $inputCode === GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')) {
                         // Set GET variables
                         $GET_VARS = '';
                         parse_str($previewConfig['getVars'], $GET_VARS);
                         GeneralUtility::_GETset($GET_VARS);
                         // Return preview keyword configuration
                         return $previewConfig;
-                    } else {
-                        // This check is to prevent people from setting additional
-                        // GET vars via realurl or other URL path based ways of passing parameters.
-                        throw new \Exception(htmlspecialchars('Request URL did not match "'
+                    }
+                    // This check is to prevent people from setting additional
+                    // GET vars via realurl or other URL path based ways of passing parameters.
+                    throw new \Exception(htmlspecialchars('Request URL did not match "'
                             . GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'index.php?' . $this->previewKey . '='
                             . $inputCode . '"', 1294585190));
-                    }
-                } else {
-                    throw new \Exception('POST requests are incompatible with keyword preview.', 1294585191);
                 }
-            } else {
-                throw new \Exception('ADMCMD command could not be executed! (No keyword configuration found)', 1294585192);
+                throw new \Exception('POST requests are incompatible with keyword preview.', 1294585191);
             }
+            throw new \Exception('ADMCMD command could not be executed! (No keyword configuration found)', 1294585192);
         }
         return false;
     }