[BUGFIX] Prevent redirection loop for shortcuts 46/37446/2
authorNicole Cordes <typo3@cordes.co>
Mon, 2 Mar 2015 10:05:16 +0000 (11:05 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 2 Mar 2015 11:00:15 +0000 (12:00 +0100)
This patch prevents the redirection to another page if the returned
URL is empty which would trigger a redirection loop.

Releases: master, 6.2
Resolves: #65447
Change-Id: Ida0fc65c83d32ca7ae45db2d02b87d7eb0c8d345
Reviewed-on: http://review.typo3.org/37446
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 0ae349d..cf5b6cc 100644 (file)
@@ -2952,8 +2952,11 @@ class TypoScriptFrontendController {
                }
                $redirectUrl = $cObj->typoLink_URL(array('parameter' => $parameter));
 
-               // redirect and exit
-               HttpUtility::redirect($redirectUrl, HttpUtility::HTTP_STATUS_307);
+               // Prevent redirection loop
+               if (!empty($redirectUrl)) {
+                       // redirect and exit
+                       HttpUtility::redirect($redirectUrl, HttpUtility::HTTP_STATUS_307);
+               }
        }
 
        /********************************************