[BUGFIX] Use given redirectUrl in „list“ wizard, if available 81/54981/2
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:38:50 +0000 (08:38 +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/54981
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Controller/Wizard/ListController.php

index f9f994b..50208f9 100644 (file)
@@ -111,7 +111,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 = BackendUtility::getModuleUrl('web_list', $urlParameters);
         }
         HttpUtility::redirect($redirectUrl);