[BUGFIX] Hardcoded fileadmin directory in Import-Export
authorThomas Löffler <loeffler@spooner-web.de>
Sun, 7 Oct 2012 10:17:44 +0000 (12:17 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 10 Oct 2012 10:58:18 +0000 (12:58 +0200)
$fileAdminDir is hardcoded in t3lib\class.t3lib_softrefproc.php
and typo3\sysext\impexp\class.tx_impexp.php
$TYPO3_CONF_VARS['BE']['fileadminDir'] should be used instead

Change-Id: I9f381507a762352ce6a555134534481e4df61f92
Releases: 4.5, 4.6, 4.7, 6.0
Resolves: #41120
Reviewed-on: http://review.typo3.org/15378
Reviewed-by: Wouter Wolters
Reviewed-by: Philipp Gampe
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Classes/Database/SoftReferenceIndex.php
typo3/sysext/impexp/classes/ImportExport.php

index 308ad7f..1d89dc3 100644 (file)
@@ -85,7 +85,7 @@ class SoftReferenceIndex {
        /**
         * @todo Define visibility
         */
-       public $fileAdminDir = 'fileadmin';
+       public $fileAdminDir = '';
 
        // Internal:
        /**
@@ -94,6 +94,14 @@ class SoftReferenceIndex {
        public $tokenID_basePrefix = '';
 
        /**
+        * Class construct to set global variable
+        *
+        */
+       public function __construct() {
+               $this->fileAdminDir = !empty($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir']) ? $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] : 'fileadmin';
+       }
+
+       /**
         * Main function through which all processing happens
         *
         * @param string $table Database table name
index c4a3486..2a3a035 100644 (file)
@@ -80,7 +80,7 @@ class ImportExport {
        /**
         * @todo Define visibility
         */
-       public $fileadminFolderName = 'fileadmin';
+       public $fileadminFolderName = '';
 
        // Whether "import" or "export" mode of object. Set through init() function
        /**
@@ -310,6 +310,7 @@ class ImportExport {
                $this->compress = function_exists('gzcompress');
                $this->dontCompress = $dontCompress;
                $this->mode = $mode;
+               $this->fileadminFolderName = !empty($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir']) ? $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] : 'fileadmin';
        }
 
        /**************************