Fix error when user-configured skin does not exist anymore (#7271)

We fallback to the system skin not the default one.
pull/7402/head
Aleksander Machniak 4 years ago
parent f6586c7cf7
commit da2bb8af6d

@ -31,6 +31,7 @@ CHANGELOG Roundcube Webmail
- Mailvelope: Use sender's address to find pubkeys to check signatures (#7348)
- Mailvelope: Fix Encrypt button hidden in Elastic (#7353)
- Fix PHP warning: count(): Parameter must be an array or an object... in ID command handler (#7392)
- Fix error when user-configured skin does not exist anymore (#7271)
RELEASE 1.4.4
-------------

@ -275,7 +275,9 @@ EOF;
public function set_skin($skin)
{
if (!$this->check_skin($skin)) {
$skin = rcube_config::DEFAULT_SKIN;
// If the skin does not exist (could be removed or invalid),
// fallback to the skin set in the system configuration (#7271)
$skin = $this->config->system_skin;
}
$skin_path = 'skins/' . $skin;

@ -27,6 +27,8 @@ class rcube_config
{
const DEFAULT_SKIN = 'elastic';
public $system_skin = 'elastic';
private $env = '';
private $paths = array();
private $prop = array();
@ -231,6 +233,8 @@ class rcube_config
$this->prop['skin'] = self::DEFAULT_SKIN;
}
$this->system_skin = $this->prop['skin'];
// fix paths
foreach (array('log_dir' => 'logs', 'temp_dir' => 'temp') as $key => $dir) {
foreach (array($this->prop[$key], '../' . $this->prop[$key], RCUBE_INSTALL_PATH . $dir) as $path) {
@ -454,7 +458,7 @@ class rcube_config
}
if ($prefs['skin'] == 'default') {
$prefs['skin'] = self::DEFAULT_SKIN;
$prefs['skin'] = $this->system_skin;
}
$skins_allowed = $this->get('skins_allowed');

Loading…
Cancel
Save