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

We fallback to the system skin not the default one.
bnet/additions
Aleksander Machniak 5 years ago
parent c25616b3b5
commit bebc9ec1be

@ -10,6 +10,7 @@ CHANGELOG Roundcube Webmail
- Mailvelope: Use sender's address to find pubkeys to check signatures (#7348) - Mailvelope: Use sender's address to find pubkeys to check signatures (#7348)
- Mailvelope: Fix Encrypt button hidden in Elastic (#7353) - 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 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 RELEASE 1.4.4
------------- -------------

@ -275,7 +275,9 @@ EOF;
public function set_skin($skin) public function set_skin($skin)
{ {
if (!$this->check_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; $skin_path = 'skins/' . $skin;

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

Loading…
Cancel
Save