[BUGFIX] Fix resource loading in composer mode 14/56614/3
authorSusanne Moog <susanne.moog@typo3.org>
Mon, 9 Apr 2018 16:04:06 +0000 (18:04 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 9 Apr 2018 18:29:20 +0000 (20:29 +0200)
Resolves: #84674
Releases: master
Change-Id: Ia3283ffcf4973e5b511a57de25cb73490916e4d2
Reviewed-on: https://review.typo3.org/56614
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Simon Gilli <typo3@gilbertsoft.org>
Tested-by: Simon Gilli <typo3@gilbertsoft.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index 4063390..07d788e 100644 (file)
@@ -251,7 +251,7 @@ class SystemEnvironmentBuilder
     public static function initializeEnvironment(ApplicationContext $context)
     {
         $sitePath = rtrim(PATH_site, '/');
-        $projectRootPath = getenv('TYPO3_PATH_APP');
+        $projectRootPath = GeneralUtility::fixWindowsFilePath(getenv('TYPO3_PATH_APP'));
         $isDifferentRootPath = ($projectRootPath && $projectRootPath !== $sitePath);
         Environment::initialize(
             $context,
index 2a9adf8..2638d48 100644 (file)
@@ -3077,7 +3077,10 @@ class GeneralUtility
         } elseif (!static::isAbsPath($filename)) {
             // is relative. Prepended with PATH_site
             $filename = PATH_site . $filename;
-        } elseif (!static::isFirstPartOfStr($filename, Environment::getProjectPath())) {
+        } elseif (!(
+                  static::isFirstPartOfStr($filename, Environment::getProjectPath())
+                  || static::isFirstPartOfStr($filename, Environment::getPublicPath())
+                )) {
             // absolute, but set to blank if not allowed
             $filename = '';
         }
@@ -3126,8 +3129,11 @@ class GeneralUtility
     {
         $lockRootPath = $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'];
         return static::isAbsPath($path) && static::validPathStr($path)
-            && (static::isFirstPartOfStr($path, Environment::getProjectPath())
-                || $lockRootPath && static::isFirstPartOfStr($path, $lockRootPath));
+            && (
+                static::isFirstPartOfStr($path, Environment::getProjectPath())
+                || static::isFirstPartOfStr($path, Environment::getPublicPath())
+                || $lockRootPath && static::isFirstPartOfStr($path, $lockRootPath)
+               );
     }
 
     /**