[Svn] r3974 - in trunk/roundcubemail: . program/include program/steps/mail program/steps/settings

trac at roundcube.net trac at roundcube.net
Sat Sep 18 18:32:01 CEST 2010


Author: thomasb
Date: 2010-09-18 11:32:00 -0500 (Sat, 18 Sep 2010)
New Revision: 3974

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/include/rcube_template.php
   trunk/roundcubemail/program/steps/mail/show.inc
   trunk/roundcubemail/program/steps/settings/save_prefs.inc
Log:
Prevent from saving a non-existing skin path in user prefs

Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-09-17 12:25:46 UTC (rev 3973)
+++ trunk/roundcubemail/CHANGELOG	2010-09-18 16:32:00 UTC (rev 3974)
@@ -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)

Modified: trunk/roundcubemail/program/include/rcube_template.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_template.php	2010-09-17 12:25:46 UTC (rev 3973)
+++ trunk/roundcubemail/program/include/rcube_template.php	2010-09-18 16:32:00 UTC (rev 3974)
@@ -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;
     }
 
     /**

Modified: trunk/roundcubemail/program/steps/mail/show.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/show.inc	2010-09-17 12:25:46 UTC (rev 3973)
+++ trunk/roundcubemail/program/steps/mail/show.inc	2010-09-18 16:32:00 UTC (rev 3974)
@@ -29,7 +29,7 @@
   if (empty($MESSAGE->headers)) {
     rcmail_message_error($uid);
   }
-
+sleep(5);
   send_nocacheing_headers();
 
   $mbox_name = $IMAP->get_mailbox_name();

Modified: trunk/roundcubemail/program/steps/settings/save_prefs.inc
===================================================================
--- trunk/roundcubemail/program/steps/settings/save_prefs.inc	2010-09-17 12:25:46 UTC (rev 3973)
+++ trunk/roundcubemail/program/steps/settings/save_prefs.inc	2010-09-18 16:32:00 UTC (rev 3974)
@@ -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)

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list