diff options
author | Simon L <szaimen@e.mail.de> | 2022-09-12 11:54:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-12 11:54:37 +0300 |
commit | 01c0b31c73298beb3c9a2405ea400b68e0c41a8d (patch) | |
tree | d8877f977a02a06a32e288a64e8b4c7908e9cbeb | |
parent | eda89d9fc9aeb6d244c6696c9b564cebffe2b7eb (diff) | |
parent | 6b8b85a375dcb4acda3cb5d2d5ac1a7ee4571eb8 (diff) |
Merge pull request #34021 from nextcloud/backport/33921/stable24
[stable24] Do not empty config.php file if reading failed for any reason
-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 = '; |