Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2022-11-13 16:11:52 +0300
committerAleksander Machniak <alec@alec.pl>2022-11-13 16:11:52 +0300
commitcb1951048c07fd175f75d0412494f23838e70c55 (patch)
treee746fcf4020d948509b48d0b7fe47ef7f9552d5e
parentb7b130e52cf6974b615c1e48d322ff70df030794 (diff)
Fix regression in create_config()HEADmaster
On update some bool options might got changed values to false, if not specified in the config.inc.php file.
-rwxr-xr-xbin/update.sh2
-rw-r--r--program/include/rcmail_install.php13
2 files changed, 11 insertions, 4 deletions
diff --git a/bin/update.sh b/bin/update.sh
index c46ad4bf6..81c1fc36a 100755
--- a/bin/update.sh
+++ b/bin/update.sh
@@ -101,7 +101,7 @@ if ($RCI->configured) {
if (!$error) {
$RCI->merge_config();
echo ". writing " . RCMAIL_CONFIG_DIR . "/config.inc.php...\n";
- $written = $RCI->save_configfile($RCI->create_config());
+ $written = $RCI->save_configfile($RCI->create_config(false));
}
// Success!
diff --git a/program/include/rcmail_install.php b/program/include/rcmail_install.php
index c91a61514..668ab502c 100644
--- a/program/include/rcmail_install.php
+++ b/program/include/rcmail_install.php
@@ -202,16 +202,23 @@ class rcmail_install
* Create configuration file that contains parameters
* that differ from default values.
*
+ * @param bool $use_post Use POSTed configuration values (of supported options)
+ *
* @return string The complete config file content
*/
- public function create_config()
+ public function create_config($use_post = true)
{
$config = [];
foreach ($this->config as $prop => $default) {
$post_value = $_POST["_$prop"] ?? null;
- $is_default = $post_value === null || !in_array($prop, $this->supported_config);
- $value = !$is_default || in_array($prop, $this->bool_config_props) ? $post_value : $default;
+ $value = $default;
+
+ if ($use_post && in_array($prop, $this->supported_config)
+ && ($post_value !== null || in_array($prop, $this->bool_config_props))
+ ) {
+ $value = $post_value;
+ }
// always disable installer
if ($prop == 'enable_installer') {