[BUGFIX] Fix check if LocalConfiguration.php is writeable 78/49778/3
authorJohannes 'ksjogo' Goslar <jogo@kronberger-spiele.de>
Tue, 16 Aug 2016 10:52:20 +0000 (12:52 +0200)
committerAndreas Wolf <andreas.wolf@typo3.org>
Fri, 2 Sep 2016 20:26:17 +0000 (22:26 +0200)
If the file exists, we only need to check if it is writeable, but do not
need to care for the folder write permissions (which are only required
to create a new file).

Change-Id: I960872af0af0e0a98cb70935916f4f2e6a91c984
Fixes: #77798
Releases: master
Reviewed-on: https://review.typo3.org/49778
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/core/Classes/Configuration/ConfigurationManager.php

index 0a25f40..e8e6c8c 100644 (file)
@@ -270,7 +270,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);
     }
 
     /**