summaryrefslogtreecommitdiffstats
path: root/lib/private/Config.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-09-06 17:22:16 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-09-12 07:48:03 +0000
commit6b8b85a375dcb4acda3cb5d2d5ac1a7ee4571eb8 (patch)
treed8877f977a02a06a32e288a64e8b4c7908e9cbeb /lib/private/Config.php
parenteda89d9fc9aeb6d244c6696c9b564cebffe2b7eb (diff)
downloadnextcloud-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.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 = ';