Aleksander Machniak
2013-06-05 55e60c6d85efa3e4b3679c8f9c0b97109ee31ca3
Fix legacy options handling

Conflicts:

CHANGELOG
2 files modified
23 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_config.php 22 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -2,6 +2,7 @@
===========================
- Fix "null" instead of empty string on messages list in IE10 (#1489145)
- Fix legacy options handling
- Fix so bounces addresses in Sender headers are skipped on Reply-All (#1489011)
- Fix bug where serialized strings were truncated in PDO::quote() (#1489142)
- Fix displaying messages with invalid self-closing HTML tags (#1489137)
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]);
            }
        }
    }
}