From 28b2a6553a9dd85f83fa6d6628cd1992d02574ce Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 3 Jun 2017 19:00:00 +0200 Subject: [PATCH] Fix bug where it wasn't possible to set timezone to auto-detected value (#5782) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_user.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7cce45ebc..c483cf227 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,7 @@ CHANGELOG Roundcube Webmail - Managesieve: Skip redundant LISTSCRIPTS command - Fix SQL syntax error on MariaDB 10.2 (#5774) - Fix bug where zipdownload ignored files with the same name (#5777) +- Fix bug where it wasn't possible to set timezone to auto-detected value (#5782) RELEASE 1.3-rc -------------- diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php index ad442436c..9b908ad5d 100644 --- a/program/lib/Roundcube/rcube_user.php +++ b/program/lib/Roundcube/rcube_user.php @@ -188,14 +188,16 @@ class rcube_user $a_user_prefs = $plugin['prefs']; $old_prefs = $plugin['old']; $config = $this->rc->config; + $defaults = $config->all(); // merge (partial) prefs array with existing settings $this->prefs = $save_prefs = $a_user_prefs + $old_prefs; unset($save_prefs['language']); // don't save prefs with default values if they haven't been changed yet + // Warning: we use result of rcube_config::all() here instead of just get() (#5782) foreach ($a_user_prefs as $key => $value) { - if ($value === null || (!isset($old_prefs[$key]) && ($value == $config->get($key)))) { + if ($value === null || (!isset($old_prefs[$key]) && $value === $defaults[$key])) { unset($save_prefs[$key]); } }