StyleSheet: Handle missing themes gracefully

This commit is contained in:
Johannes Meyer 2021-11-02 15:09:52 +01:00
parent aa101e18c8
commit fd4ab2babc

View File

@ -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';
} }