diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-06 17:22:16 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-06 17:37:34 +0200 |
commit | c2dafb099781a31745749ae399cf864b2a195000 (patch) | |
tree | 3237248d4d37b138fd293028a377264ab3a15d69 /lib/private/Config.php | |
parent | 2c08e6f080109dad54552652809dc8a51f04b82d (diff) | |
download | nextcloud-server-c2dafb099781a31745749ae399cf864b2a195000.tar.gz nextcloud-server-c2dafb099781a31745749ae399cf864b2a195000.zip |
Do not empty config.php file if reading failed for any reason
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Config.php')
-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 = '; |