Aleksander Machniak
2013-06-05 55e60c6d85efa3e4b3679c8f9c0b97109ee31ca3
program/lib/Roundcube/rcube_config.php
@@ -174,7 +174,7 @@
            ob_end_clean();
            if (is_array($rcmail_config)) {
                $this->prop = array_merge($this->prop, $rcmail_config, $this->userprefs);
                $this->merge($rcmail_config);
                return true;
            }
        }
@@ -194,9 +194,6 @@
    {
        if (isset($this->prop[$name])) {
            $result = $this->prop[$name];
        }
        else if (isset($this->legacy_props[$name])) {
            return $this->get($this->legacy_props[$name], $def);
        }
        else {
            $result = $def;
@@ -241,6 +238,7 @@
    public function merge($prefs)
    {
        $this->prop = array_merge($this->prop, $prefs, $this->userprefs);
        $this->fix_legacy_props();
    }
@@ -272,6 +270,8 @@
        $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') {
@@ -435,4 +435,18 @@
        return date_default_timezone_get();
    }
    /**
     * Convert legacy options into new ones
     */
    private function fix_legacy_props()
    {
        foreach ($this->legacy_props as $new => $old) {
            if (isset($this->prop[$old])) {
                if (!isset($this->prop[$new])) {
                    $this->prop[$new] = $this->prop[$old];
                }
                unset($this->prop[$old]);
            }
        }
    }
}