[BUGFIX] Copying directories is impossible
authorAndreas Wolf <andreas.wolf@ikt-werk.de>
Thu, 22 Sep 2011 21:05:00 +0000 (23:05 +0200)
committerXavier Perseguers <xavier@typo3.org>
Tue, 4 Oct 2011 14:41:29 +0000 (16:41 +0200)
Due to a bug introduced with a refactoring of t3lib_extFileFunc, it
became impossible to copy directories. The two wrong statements (they
were not inverted though they should have been) are fixed with this
commit.

Change-Id: Iaac9cbcf30e2b73e2fd7f5df6986e1ccdf76c079
Resolves: #30213
Related: #24218
Releases: 4.6
Reviewed-on: http://review.typo3.org/5241
Reviewed-by: Markus Klein
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Tested-by: Markus Klein
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/class.t3lib_extfilefunc.php

index de446a6..807042a 100644 (file)
@@ -529,12 +529,12 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions {
                                $this->writelog(2, 1, 123, 'Target "%s" already exists!', array($theDestFile));
                                return FALSE;
                        }
-                       if (!t3lib_div::isFirstPartOfStr($theDestFile . '/', $theFile . '/')) {
+                       if (t3lib_div::isFirstPartOfStr($theDestFile . '/', $theFile . '/')) {
                                $this->writelog(2, 1, 122, 'Destination cannot be inside the target! D="%s", T="%s"', array($theDestFile . '/', $theFile . '/'));
                                return FALSE;
                        }
                                // Check if the one folder is inside the other or on the same level... to target/dest is the same?
-                       if ($this->checkIfFullAccess($theDest) || $this->is_webPath($theDestFile) == $this->is_webPath($theFile)) { // no copy of folders between spaces
+                       if (!$this->checkIfFullAccess($theDest) && $this->is_webPath($theDestFile) !== $this->is_webPath($theFile)) { // no copy of folders between spaces
                                $this->writelog(2, 1, 121, 'You don\'t have full access to the destination directory "%s"!', array($theDest . '/'));
                                return FALSE;
                        }