Skip to content

Commit

Permalink
Do not empty config.php file if reading failed for any reason
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Sep 6, 2022
1 parent 2c08e6f commit 72ffa0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ private function readData() {
private function writeData() {
$this->checkReadOnly();

if (!is_file(\OC::$configDir.'/CAN_INSTALL') && !isset($this->cache['version']) || !isset($this->cache['installed'])) {
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 = ';
Expand Down

0 comments on commit 72ffa0a

Please sign in to comment.