Skip to content

Commit 01c0b31

Browse files
authored
Merge pull request #34021 from nextcloud/backport/33921/stable24
[stable24] Do not empty config.php file if reading failed for any reason
2 parents eda89d9 + 6b8b85a commit 01c0b31

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
@@ -254,6 +254,10 @@ private function readData() {
254254
private function writeData() {
255255
$this->checkReadOnly();
256256

257+
if (!is_file(\OC::$configDir.'/CAN_INSTALL') && !isset($this->cache['version'])) {
258+
throw new HintException(sprintf('Configuration was not read or initialized correctly, not overwriting %s', $this->configFilePath));
259+
}
260+
257261
// Create a php file ...
258262
$content = "<?php\n";
259263
$content .= '$CONFIG = ';

0 commit comments

Comments
 (0)