[BUGFIX] Use given redirectUrl in „list“ wizard, if available 41/54841/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 28 Nov 2017 20:41:40 +0000 (21:41 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 8 Dec 2017 07:23:37 +0000 (08:23 +0100)
The „list“ wizard now checks whether the redirectUrl was given with
the request and uses this, otherwise it falls back to REQUEST_URI.

Resolves: #83146
Releases: master, 8.7
Change-Id: I0572e6f20c89f77bf11a1c7c2257e4a2c10f4f12
Reviewed-on: https://review.typo3.org/54841
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Wolfgang Klinger <wolfgang@wazum.com>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Controller/Wizard/ListController.php

index 3d05327..d08fab8 100644 (file)
@@ -112,7 +112,9 @@ class ListController extends AbstractWizardController
             $urlParameters = [];
             $urlParameters['id'] = $this->pid;
             $urlParameters['table'] = $this->P['params']['table'];
-            $urlParameters['returnUrl'] = GeneralUtility::getIndpEnv('REQUEST_URI');
+            $urlParameters['returnUrl'] = !empty($this->P['returnUrl'])
+                ? GeneralUtility::sanitizeLocalUrl($this->P['returnUrl'])
+                : GeneralUtility::getIndpEnv('REQUEST_URI');
             $redirectUrl = (string)$uriBuilder->buildUriFromRoute('web_list', $urlParameters);
         }
         HttpUtility::redirect($redirectUrl);