Aleksander Machniak
2015-06-16 26a00e76bed78b67443d22faf5664967ce96cbf7
Fix race-condition in saving user preferences and loading plugin config (#1490431)
2 files modified
8 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_user.php 7 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -15,6 +15,7 @@
- Fix Compose action in addressbook for results from multiple addressbooks (#1490413)
- Fix bug where some messages in multi-folder search couldn't be opened (#1490426)
- Fix unintentional messages list page change on page switch in compose addressbook (#1490427)
- Fix race-condition in saving user preferences and loading plugin config (#1490431)
RELEASE 1.1.2
-------------
program/lib/Roundcube/rcube_user.php
@@ -195,8 +195,9 @@
        // don't save prefs with default values if they haven't been changed yet
        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 == $config->get($key)))) {
                unset($save_prefs[$key]);
            }
        }
        $save_prefs = serialize($save_prefs);
@@ -217,7 +218,7 @@
            $this->data['preferences'] = $save_prefs;
            if (!$no_session) {
                $config->set_user_prefs($a_user_prefs);
                $config->set_user_prefs($this->prefs);
                if (isset($_SESSION['preferences'])) {
                    $this->rc->session->remove('preferences');
@@ -235,7 +236,7 @@
        ) {
            $_SESSION['preferences'] = $save_prefs;
            $_SESSION['preferences_time'] = time();
            $config->set_user_prefs($a_user_prefs);
            $config->set_user_prefs($this->prefs);
            $this->data['preferences'] = $save_prefs;
        }