Skip to content

Commit

Permalink
Merge pull request #34021 from nextcloud/backport/33921/stable24
Browse files Browse the repository at this point in the history
[stable24] Do not empty config.php file if reading failed for any reason
  • Loading branch information
szaimen authored Sep 12, 2022
2 parents eda89d9 + 6b8b85a commit 01c0b31
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 @@ -254,6 +254,10 @@ private function readData() {
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 = ';
Expand Down

0 comments on commit 01c0b31

Please sign in to comment.