[BUGFIX] Check if LocalConfiguration.php is writable 78/53878/3
authorBenni Mack <benni@typo3.org>
Mon, 4 Sep 2017 15:13:20 +0000 (17:13 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 5 Sep 2017 07:51:40 +0000 (09:51 +0200)
In TYPO3 v8, the ConfigurationManager only checks if LocalConfiguration.php
is writaeble and not if typo3conf itself is writable.

Optimizing this check removes a warning in an environment where typo3conf/
is hardened to only have LocalConfiguration.php be modified and nothing else.
This change helps running TYPO3 v7 on platform.sh with fewer error messages.

You can compare this line of code with the same line in TYPO3 v8/master.

Resolves: #82289
Releases: 7.6
Change-Id: I7adca89eaa0d9f5b28e3f034f9452d97591a0d80
Reviewed-on: https://review.typo3.org/53878
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/core/Classes/Configuration/ConfigurationManager.php

index b4d8265..071ffa5 100644 (file)
@@ -271,7 +271,7 @@ class ConfigurationManager
     public function canWriteConfiguration()
     {
         $fileLocation = $this->getLocalConfigurationFileLocation();
-        return @is_writable($this->pathTypo3Conf) && (!file_exists($fileLocation) || @is_writable($fileLocation));
+        return @is_writable(file_exists($fileLocation) ? $fileLocation : $this->pathTypo3Conf);
     }
 
     /**