summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-09-01 12:47:49 +0200
committerAleksander Machniak <alec@alec.pl>2013-09-01 12:47:49 +0200
commit993cb6627bc70e86fa8c3db1e21272834fcc3fb3 (patch)
tree68d319081b0c5d70ac0127830c712235c3238399
parent153891e036603c049c2fb2c05e52a236ad3f89ea (diff)
Fix issue where legacy config was overriden by default config (#1489288)
-rw-r--r--CHANGELOG1
-rw-r--r--program/lib/Roundcube/rcube_config.php24
2 files changed, 16 insertions, 9 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9b68a4274..f172d4081 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix issue where legacy config was overriden by default config (#1489288)
- Add temp_dir_ttl configuration option (#1489304)
- Fix newmail_notifier issue where favicon wasn't changed back to default (#1489313)
- Allow setting INBOX as Sent folder (#1489219)
diff --git a/program/lib/Roundcube/rcube_config.php b/program/lib/Roundcube/rcube_config.php
index 62567a0e0..90e1394cf 100644
--- a/program/lib/Roundcube/rcube_config.php
+++ b/program/lib/Roundcube/rcube_config.php
@@ -282,8 +282,8 @@ class rcube_config
*/
public function merge($prefs)
{
+ $prefs = $this->fix_legacy_props($prefs);
$this->prop = array_merge($this->prop, $prefs, $this->userprefs);
- $this->fix_legacy_props();
}
@@ -295,6 +295,8 @@ class rcube_config
*/
public function set_user_prefs($prefs)
{
+ $prefs = $this->fix_legacy_props($prefs);
+
// Honor the dont_override setting for any existing user preferences
$dont_override = $this->get('dont_override');
if (is_array($dont_override) && !empty($dont_override)) {
@@ -316,8 +318,6 @@ class rcube_config
$this->userprefs = $prefs;
$this->prop = array_merge($this->prop, $prefs);
- $this->fix_legacy_props();
-
// override timezone settings with client values
if ($this->prop['timezone'] == 'auto') {
$this->prop['_timezone_value'] = isset($_SESSION['timezone']) ? $this->client_timezone() : $this->prop['_timezone_value'];
@@ -330,7 +330,7 @@ class rcube_config
/**
* Getter for all config options
*
- * @return array Hash array containg all config properties
+ * @return array Hash array containing all config properties
*/
public function all()
{
@@ -482,16 +482,22 @@ class rcube_config
/**
* Convert legacy options into new ones
+ *
+ * @param array $props Hash array with config props
+ *
+ * @return array Converted config props
*/
- private function fix_legacy_props()
+ private function fix_legacy_props($props)
{
foreach ($this->legacy_props as $new => $old) {
- if (isset($this->prop[$old])) {
- if (!isset($this->prop[$new])) {
- $this->prop[$new] = $this->prop[$old];
+ if (isset($props[$old])) {
+ if (!isset($props[$new])) {
+ $props[$new] = $props[$old];
}
- unset($this->prop[$old]);
+ unset($props[$old]);
}
}
+
+ return $props;
}
}