[BUGFIX] Default upload folder should be user_upload/ 23/19223/2
authorBenjamin Mack <benni@typo3.org>
Sat, 23 Mar 2013 15:27:52 +0000 (16:27 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sun, 24 Mar 2013 09:47:52 +0000 (10:47 +0100)
The default folder in FAL is set to temp. However, temp should
be used for temporary files like import/export t3d files,
not uploads by the user.
In 99% of the use case, the uploaded files should be accessible
by the frontend (which temp isn't because of a .htaccess file).
That's why the fileadmin/user_upload/ should always be
created in the install tool, AND the user_upload file
should be the default folder for the local driver.

Resolves: #46604
Releases: 6.1, 6.0
Change-Id: I79319bab4bad76c1af9e001a0a5146fae85ce59f
Reviewed-on: https://review.typo3.org/19223
Reviewed-by: Wouter Wolters
Reviewed-by: Tom Ruether
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php
typo3/sysext/install/Classes/Installer.php

index 72d0ef6..e327365 100644 (file)
@@ -180,10 +180,10 @@ class LocalDriver extends \TYPO3\CMS\Core\Resource\Driver\AbstractDriver {
         */
        public function getDefaultFolder() {
                if (!$this->defaultLevelFolder) {
-                       if (!file_exists(($this->absoluteBasePath . '_temp_/'))) {
-                               mkdir($this->absoluteBasePath . '_temp_/');
+                       if (!file_exists(($this->absoluteBasePath . 'user_upload/'))) {
+                               mkdir($this->absoluteBasePath . 'user_upload/');
                        }
-                       $this->defaultLevelFolder = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->createFolderObject($this->storage, '/_temp_/', '');
+                       $this->defaultLevelFolder = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->createFolderObject($this->storage, '/user_upload/', '');
                }
                return $this->defaultLevelFolder;
        }
index d2a88a4..1857e60 100644 (file)
@@ -2043,7 +2043,8 @@ REMOTE_ADDR was \'' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE
                        'uploads/pics/' => array('Typical location for uploaded files (images especially).', 0),
                        'uploads/media/' => array('Typical location for uploaded files (non-images especially).', 0),
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] => array('Location for local files such as templates, independent uploads etc.', -1),
-                       $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . '_temp_/' => array('Typical temporary location for default upload of files by administrators.', 0)
+                       $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . '_temp_/' => array('Typical temporary location for default upload of administrative files like import/export data, used by administrators.', 0),
+                       $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . 'user_upload/' => array('Default upload location for images by editors via Rich Text Editor and upload fields in the backend.', 0)
                );
                foreach ($checkWrite as $relpath => $descr) {
                        // Check typo3temp/