[BUGFIX] Prevent redirection loop for shortcuts 49/37449/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:33 +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/37449
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 25b36b9..296f1b6 100644 (file)
@@ -3215,8 +3215,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);
+               }
        }
 
        /********************************************