mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Merge pull request #4580 from Icinga/fix/missing-themes-cause-errors-4512
Fix missing themes cause errors
This commit is contained in:
commit
58997aecaa
@ -211,8 +211,9 @@ class PreferenceForm extends Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($formData['theme']) && $formData['theme'] !== StyleSheet::DEFAULT_THEME) {
|
if (isset($formData['theme']) && $formData['theme'] !== StyleSheet::DEFAULT_THEME) {
|
||||||
$file = file_get_contents(StyleSheet::getThemeFile($formData['theme']));
|
$themeFile = StyleSheet::getThemeFile($formData['theme']);
|
||||||
if (! preg_match(StyleSheet::REGEX_ALL_MODE_QUERY, $file)) {
|
$file = $themeFile !== null ? @file_get_contents($themeFile) : false;
|
||||||
|
if ($file && ! preg_match(StyleSheet::REGEX_ALL_MODE_QUERY, $file)) {
|
||||||
$disabled = ['', 'light', 'system'];
|
$disabled = ['', 'light', 'system'];
|
||||||
if (preg_match(StyleSheet::REGEX_AUTO_MODE_QUERY, $file)) {
|
if (preg_match(StyleSheet::REGEX_AUTO_MODE_QUERY, $file)) {
|
||||||
$value = 'system';
|
$value = 'system';
|
||||||
|
@ -181,8 +181,8 @@ class StyleSheet
|
|||||||
|
|
||||||
$mode = 'none';
|
$mode = 'none';
|
||||||
if ($user = Auth::getInstance()->getUser()) {
|
if ($user = Auth::getInstance()->getUser()) {
|
||||||
$file = $themePath !== null ? file_get_contents($themePath) : '';
|
$file = $themePath !== null ? @file_get_contents($themePath) : '';
|
||||||
if ($file !== '' && ! preg_match(self::REGEX_ALL_MODE_QUERY, $file)) {
|
if ($file && $file !== '' && ! preg_match(self::REGEX_ALL_MODE_QUERY, $file)) {
|
||||||
if (preg_match(self::REGEX_AUTO_MODE_QUERY, $file)) {
|
if (preg_match(self::REGEX_AUTO_MODE_QUERY, $file)) {
|
||||||
$mode = 'system';
|
$mode = 'system';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user