summaryrefslogtreecommitdiff
path: root/program/include/rcube_template.php
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-09-18 16:32:00 +0000
committerthomascube <thomas@roundcube.net>2010-09-18 16:32:00 +0000
commit62c791f60923e12ef157f6de7018d0f7ada47911 (patch)
tree16d6c4db1788a6e993508f2b9268b3f759588e29 /program/include/rcube_template.php
parentffc040bf9ea603ab9c5d752a222caf22627643c7 (diff)
Prevent from saving a non-existing skin path in user prefs
Diffstat (limited to 'program/include/rcube_template.php')
-rwxr-xr-xprogram/include/rcube_template.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index f301b3618..4c59c4197 100755
--- a/program/include/rcube_template.php
+++ b/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;
}
/**