diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-09-12 09:43:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-12 09:43:33 +0200 |
commit | 1f7e769ed6ce1e7fe6b093c0e77a3f281b8c8ad3 (patch) | |
tree | 1d1c73939391c380d950711df5aeccf116df5fa1 /lib | |
parent | 1a6d7dc12f67c3a4f36b4867df0767c6f72960a5 (diff) | |
parent | c2dafb099781a31745749ae399cf864b2a195000 (diff) | |
download | nextcloud-server-1f7e769ed6ce1e7fe6b093c0e77a3f281b8c8ad3.tar.gz nextcloud-server-1f7e769ed6ce1e7fe6b093c0e77a3f281b8c8ad3.zip |
Merge pull request #33921 from nextcloud/fix/fix-config-file-emptied
Do not empty config.php file if reading failed for any reason
Diffstat (limited to 'lib')
-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 = '; |