[BUGFIX] Ensure parse_str method argument is valid for BE shortcuts 39/60239/3
authorJoerg Kummer <typo3@enobe.de>
Wed, 13 Mar 2019 16:04:26 +0000 (17:04 +0100)
committerBenjamin Franzke <bfr@qbus.de>
Sun, 17 Mar 2019 17:33:23 +0000 (18:33 +0100)
When backend shortcut links get parsed, this change ensures that
parameter for returnUrl get only parsed, if it is set and not empty.

Resolves: #87903
Releases: master, 9.5
Change-Id: Ie8f380e9cdfef4440153f2095797a2dccc577d1c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60239
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
typo3/sysext/backend/Classes/Backend/Shortcut/ShortcutRepository.php

index 8baae1e..cae3169 100644 (file)
@@ -735,7 +735,7 @@ class ShortcutRepository
 
         $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         // parse the returnUrl and replace the module token of it
-        if (isset($parameters['returnUrl'])) {
+        if (!empty($parameters['returnUrl'])) {
             $parsedReturnUrl = parse_url($parameters['returnUrl']);
             $returnUrlParameters = [];
             parse_str($parsedReturnUrl['query'], $returnUrlParameters);