diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-06 18:22:16 +0300 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-06 18:37:34 +0300 |
commit | c2dafb099781a31745749ae399cf864b2a195000 (patch) | |
tree | 3237248d4d37b138fd293028a377264ab3a15d69 /lib/private | |
parent | 2c08e6f080109dad54552652809dc8a51f04b82d (diff) |
Do not empty config.php file if reading failed for any reasonfix/fix-config-file-emptied
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Config.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Config.php b/lib/private/Config.php index 37708357339..ba3b8c6fe4d 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -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 = '; |