Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Do not empty config.php file if reading failed for any reason
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: szaimen <[email protected]>
  • Loading branch information
szaimen committed Sep 12, 2022
commit 5851c265a1009e88e4018f44cb1b76fa21e9cbc2
4 changes: 4 additions & 0 deletions lib/private/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ private function readData() {
* @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 = ';
Expand Down