Skip to content

Commit

Permalink
Fix missing global theme check refs #4723 (#4724)
Browse files Browse the repository at this point in the history
(cherry picked from commit ba677de)
  • Loading branch information
moreamazingnick authored and nilmerg committed Apr 5, 2022
1 parent a6a3de3 commit a76881f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion application/forms/PreferenceForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public function createElements(array $formData)
);
}

$themeFile = StyleSheet::getThemeFile(Config::app()->get('themes', 'default'));
if (! (bool) Config::app()->get('themes', 'disabled', false)) {
$themes = Icinga::app()->getThemes();
if (count($themes) > 1) {
Expand All @@ -212,7 +213,10 @@ public function createElements(array $formData)

if (isset($formData['theme']) && $formData['theme'] !== StyleSheet::DEFAULT_THEME) {
$themeFile = StyleSheet::getThemeFile($formData['theme']);
$file = $themeFile !== null ? @file_get_contents($themeFile) : false;
}

if ($themeFile !== null) {
$file = @file_get_contents($themeFile);
if ($file && strpos($file, StyleSheet::LIGHT_MODE_IDENTIFIER) === false) {
$disabled = ['', 'light', 'system'];
}
Expand Down

0 comments on commit a76881f

Please sign in to comment.