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
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2022-09-12 11:54:37 +0300
committerGitHub <noreply@github.com>2022-09-12 11:54:37 +0300
commit01c0b31c73298beb3c9a2405ea400b68e0c41a8d (patch)
treed8877f977a02a06a32e288a64e8b4c7908e9cbeb
parenteda89d9fc9aeb6d244c6696c9b564cebffe2b7eb (diff)
parent6b8b85a375dcb4acda3cb5d2d5ac1a7ee4571eb8 (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.php4
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 = ';