[BUGFIX] Use proper URL for file list of returnUrl in file_upload 29/46729/3
authorBenni Mack <benni@typo3.org>
Tue, 16 Feb 2016 19:58:36 +0000 (20:58 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Wed, 24 Feb 2016 11:15:16 +0000 (12:15 +0100)
When the file upload controller is called (which is almost
impossible to call these days) and no return URL is given
(which is again almost impossible), then the URL is invalid.

The patch uses the proper getModuleUrl() call which is
sufficient.

Resolves: #73506
Releases: master, 7.6
Change-Id: I49830e84cb10c14ccb84ea932927898899e58e70
Reviewed-on: https://review.typo3.org/46729
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/Controller/File/FileUploadController.php

index d87e951..5a95dfe 100644 (file)
@@ -85,9 +85,9 @@ class FileUploadController extends AbstractModule
         $this->target = GeneralUtility::_GP('target');
         $this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
         if (!$this->returnUrl) {
-            $this->returnUrl = GeneralUtility::getIndpEnv('TYPO3_SITE_URL')
-                . TYPO3_mainDir . BackendUtility::getModuleUrl('file_list')
-                . '&id=' . rawurlencode($this->target);
+            $this->returnUrl = BackendUtility::getModuleUrl('file_list', [
+                'id' => rawurlencode($this->target)
+            ]);
         }
         // Create the folder object
         if ($this->target) {