[TASK] Improve prevention of redirect loop 77/53977/5
authorChristoph Lehmann <christoph.lehmann@networkteam.com>
Thu, 7 Sep 2017 20:24:17 +0000 (22:24 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 7 Feb 2018 18:49:11 +0000 (19:49 +0100)
This prevents a redirect loop with realurl where an editor
doesn't see the pagetree of his login domain in his workspace
and opens his login domain in the FE. As result he sees the
requested page.

Resolves: #82297
Releases: master, 8.7
Change-Id: Ie948f6defa21e3e1d8766533f54a48769d2220c9
Reviewed-on: https://review.typo3.org/53977
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Sascha Rademacher <sascha.rademacher+typo3@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Reiner Teubner <rteubner@me.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index c340323..d580ccf 100644 (file)
@@ -2968,7 +2968,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             'addQueryString.' => ['exclude' => 'id']]);
 
         // Prevent redirection loop
-        if (!empty($redirectUrl)) {
+        if (!empty($redirectUrl) && GeneralUtility::getIndpEnv('REQUEST_URI') !== '/' . $redirectUrl) {
             // redirect and exit
             HttpUtility::redirect($redirectUrl, HttpUtility::HTTP_STATUS_307);
         }