[BUGFIX] Do not use empty needle in strpos in SimpleFileBackend 32/58132/3
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 2 Sep 2018 21:33:59 +0000 (23:33 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 3 Sep 2018 08:33:54 +0000 (10:33 +0200)
This only happens on Windows as the call is inside a condition
that tests for Windows OS.

Releases: master
Resolves: #86091
Change-Id: I0e7801d9e80cf675cc6d99d35cf6dd95c2cace44
Reviewed-on: https://review.typo3.org/58132
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php

index b107b47..7bdfd62 100644 (file)
@@ -164,7 +164,7 @@ class SimpleFileBackend extends AbstractBackend implements PhpCapableBackendInte
                 $documentRoot = '';
             }
             if (Environment::isWindows()) {
-                if (strpos($cacheDirectory, $documentRoot) === 0) {
+                if (!empty($documentRoot) && strpos($cacheDirectory, $documentRoot) === 0) {
                     $documentRoot = '';
                 }
             }