Skip to content

Commit 72ffa0a

Browse files
committed
Do not empty config.php file if reading failed for any reason
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 2c08e6f commit 72ffa0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/private/Config.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ private function readData() {
262262
private function writeData() {
263263
$this->checkReadOnly();
264264

265+
if (!is_file(\OC::$configDir.'/CAN_INSTALL') && !isset($this->cache['version']) || !isset($this->cache['installed'])) {
266+
throw new HintException(sprintf('Configuration was not read or initialized correctly, not overwriting %s', $this->configFilePath));
267+
}
268+
265269
// Create a php file ...
266270
$content = "<?php\n";
267271
$content .= '$CONFIG = ';

0 commit comments

Comments
 (0)