Merge pull request #33921 from nextcloud/fix/fix-config-file-emptied

Do not empty config.php file if reading failed for any reason
This commit is contained in:
Côme Chilliet 2022-09-12 09:43:33 +02:00 committed by GitHub
commit 1f7e769ed6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -262,6 +262,10 @@ class Config {
private function writeData() {
$this->checkReadOnly();
if (!is_file(\OC::$configDir.'/CAN_INSTALL') && !isset($this->cache['version'])) {
throw new HintException(sprintf('Configuration was not read or initialized correctly, not overwriting %s', $this->configFilePath));
}
// Create a php file ...
$content = "<?php\n";
$content .= '$CONFIG = ';