]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not empty config.php file if reading failed for any reason 34025/head
authorszaimen <szaimen@e.mail.de>
Mon, 12 Sep 2022 09:01:38 +0000 (11:01 +0200)
committerszaimen <szaimen@e.mail.de>
Mon, 12 Sep 2022 09:01:38 +0000 (11:01 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: szaimen <szaimen@e.mail.de>
lib/private/Config.php

index 2a83d2300dcd40ec78ef1724bfc19065857d1d1d..a1753c8be3189a142ca5194adff0af5fc1e458fa 100644 (file)
@@ -239,6 +239,10 @@ class Config {
         * @throws \Exception If no file lock can be acquired
         */
        private function writeData() {
+               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 = ';