[TASK] Improve prevention of redirect loop 90/55590/2
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 19:07:49 +0000 (20:07 +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/55590
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 199a12d..6659137 100644 (file)
@@ -2939,7 +2939,7 @@ class TypoScriptFrontendController
             '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);
         }