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:
authorszaimen <szaimen@e.mail.de>2022-09-12 12:01:38 +0300
committerszaimen <szaimen@e.mail.de>2022-09-12 12:01:38 +0300
commit5851c265a1009e88e4018f44cb1b76fa21e9cbc2 (patch)
tree54f852a4829cc7ce339121a3ea7a75aeb87e3024
parent66a4ee996814a95c181a73fa7fd7073ad2ca79dd (diff)
Do not empty config.php file if reading failed for any reason
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com> Signed-off-by: szaimen <szaimen@e.mail.de>
-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 2a83d2300dc..a1753c8be31 100644
--- a/lib/private/Config.php
+++ b/lib/private/Config.php
@@ -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 = ';