thomascube
2010-09-18 62c791f60923e12ef157f6de7018d0f7ada47911
Prevent from saving a non-existing skin path in user prefs

4 files modified
20 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/include/rcube_template.php 12 ●●●● patch | view | raw | blame | history
program/steps/mail/show.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/save_prefs.inc 5 ●●●●● patch | view | raw | blame | history
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)
program/include/rcube_template.php
@@ -138,13 +138,21 @@
     */
    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;
    }
    /**
program/steps/mail/show.inc
@@ -29,7 +29,7 @@
  if (empty($MESSAGE->headers)) {
    rcmail_message_error($uid);
  }
sleep(5);
  send_nocacheing_headers();
  $mbox_name = $IMAP->get_mailbox_name();
program/steps/settings/save_prefs.inc
@@ -116,8 +116,9 @@
      $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)