Skip to content

Commit

Permalink
Insert missing settings before end tag in Config::updateSettingsFile()
Browse files Browse the repository at this point in the history
Fixes a bug introduced by #8273

Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Jul 1, 2024
1 parent 93d1247 commit 85eb2a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,11 @@ function ($a, $b) {
continue;
}

$settingsText .= "\n\n" . $substitutions[$var]['replacement'];
if (str_contains($settingsText, $substitutions[-2]['replacement'])) {
$settingsText = preg_replace($substitutions[-2]['search_pattern'], "\n\n" . $substitutions[$var]['replacement'] . "\n\n$0", $settingsText);
} else {
$settingsText .= "\n\n" . $substitutions[$var]['replacement'];
}
}
} else {
// If the comments for some variables have changed since the last
Expand Down

0 comments on commit 85eb2a0

Please sign in to comment.