diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-06 17:22:16 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2022-09-12 07:48:03 +0000 |
commit | 6b8b85a375dcb4acda3cb5d2d5ac1a7ee4571eb8 (patch) | |
tree | d8877f977a02a06a32e288a64e8b4c7908e9cbeb /lib/private/Config.php | |
parent | eda89d9fc9aeb6d244c6696c9b564cebffe2b7eb (diff) | |
download | nextcloud-server-6b8b85a375dcb4acda3cb5d2d5ac1a7ee4571eb8.tar.gz nextcloud-server-6b8b85a375dcb4acda3cb5d2d5ac1a7ee4571eb8.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 b044d0731a3..0e3a9b22a77 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -254,6 +254,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 = '; |