diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-18 16:32:00 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-18 16:32:00 +0000 |
| commit | cb16d146019fa85984696a47e9863e526803a62b (patch) | |
| tree | bb5eda8980768793e3b7d0b2a9ffd029c888fd54 | |
| parent | 49dcb7a60cd3480888845df9021c58272738d4af (diff) | |
Prevent from saving a non-existing skin path in user prefs
git-svn-id: https://svn.roundcube.net/trunk@3974 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/CHANGELOG | 1 | ||||
| -rwxr-xr-x | roundcubemail/program/include/rcube_template.php | 12 | ||||
| -rw-r--r-- | roundcubemail/program/steps/mail/show.inc | 2 | ||||
| -rw-r--r-- | roundcubemail/program/steps/settings/save_prefs.inc | 5 |
4 files changed, 15 insertions, 5 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG index 1ece7d52d..51033a281 100644 --- a/roundcubemail/CHANGELOG +++ b/roundcubemail/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG RoundCube Webmail =========================== +- Prevent from saving a non-existing skin path in user prefs (#1486936) - Improve handling of single-part messages with bogus BODYSTRUCTURE (#1486898) - Fix path to SQL files when using pgsql/mysqli/sqlsrv drivers (#1486902) - Fix upgrade script for SQLite (#1486903) diff --git a/roundcubemail/program/include/rcube_template.php b/roundcubemail/program/include/rcube_template.php index f301b3618..4c59c4197 100755 --- a/roundcubemail/program/include/rcube_template.php +++ b/roundcubemail/program/include/rcube_template.php @@ -138,13 +138,21 @@ class rcube_template extends rcube_html_page */ public function set_skin($skin) { - if (!empty($skin) && is_dir('skins/'.$skin) && is_readable('skins/'.$skin)) + $valid = false; + + if (!empty($skin) && is_dir('skins/'.$skin) && is_readable('skins/'.$skin)) { $skin_path = 'skins/'.$skin; - else + $valid = true; + } + else { $skin_path = $this->config['skin_path'] ? $this->config['skin_path'] : 'skins/default'; + $valid = !$skin; + } $this->app->config->set('skin_path', $skin_path); $this->config['skin_path'] = $skin_path; + + return $valid; } /** diff --git a/roundcubemail/program/steps/mail/show.inc b/roundcubemail/program/steps/mail/show.inc index 69b30eb4d..a9dbced90 100644 --- a/roundcubemail/program/steps/mail/show.inc +++ b/roundcubemail/program/steps/mail/show.inc @@ -29,7 +29,7 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) { if (empty($MESSAGE->headers)) { rcmail_message_error($uid); } - +sleep(5); send_nocacheing_headers(); $mbox_name = $IMAP->get_mailbox_name(); diff --git a/roundcubemail/program/steps/settings/save_prefs.inc b/roundcubemail/program/steps/settings/save_prefs.inc index 3f13c0af4..a8ff87869 100644 --- a/roundcubemail/program/steps/settings/save_prefs.inc +++ b/roundcubemail/program/steps/settings/save_prefs.inc @@ -116,8 +116,9 @@ switch ($CURR_SECTION) $OUTPUT->command('reload', 500); } - // switch skin - $OUTPUT->set_skin($a_user_prefs['skin']); + // switch skin (if valid, otherwise unset the pref and fall back to default) + if (!$OUTPUT->set_skin($a_user_prefs['skin'])) + unset($a_user_prefs['skin']); // force min size if ($a_user_prefs['pagesize'] < 1) |
