Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2022-09-12 10:43:33 +0300
committerGitHub <noreply@github.com>2022-09-12 10:43:33 +0300
commit1f7e769ed6ce1e7fe6b093c0e77a3f281b8c8ad3 (patch)
tree1d1c73939391c380d950711df5aeccf116df5fa1 /lib
parent1a6d7dc12f67c3a4f36b4867df0767c6f72960a5 (diff)
parentc2dafb099781a31745749ae399cf864b2a195000 (diff)
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.php4
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 = ';