[BUGFIX] Resolve relative file path during copy correctly 15/58415/2
authorOliver Hader <oliver@typo3.org>
Thu, 27 Sep 2018 18:11:30 +0000 (20:11 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Thu, 27 Sep 2018 19:19:36 +0000 (21:19 +0200)
In composer mode several directories are arranged outside the
public root-path. When trying to copy to those folders, the
public root-path is prefixed due an invalid check which is
too strict. The expectation is to use public root-path
(PATH_site) when resolving relative paths here.

Resolves: #86407
Releases: master
Change-Id: I666b08311e06289c64943518682ab4a970b35a2b
Reviewed-on: https://review.typo3.org/58415
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index c1c08ff..080e830 100644 (file)
@@ -3255,10 +3255,10 @@ class GeneralUtility
      */
     public static function copyDirectory($source, $destination)
     {
-        if (strpos($source, Environment::getPublicPath() . '/') === false) {
+        if (strpos($source, Environment::getProjectPath() . '/') === false) {
             $source = Environment::getPublicPath() . '/' . $source;
         }
-        if (strpos($destination, Environment::getPublicPath() . '/') === false) {
+        if (strpos($destination, Environment::getProjectPath() . '/') === false) {
             $destination = Environment::getPublicPath() . '/' . $destination;
         }
         if (static::isAllowedAbsPath($source) && static::isAllowedAbsPath($destination)) {