diff options
Diffstat (limited to 'Zotlabs/Render/Theme.php')
-rw-r--r-- | Zotlabs/Render/Theme.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php index a42b65e03..2faf3631a 100644 --- a/Zotlabs/Render/Theme.php +++ b/Zotlabs/Render/Theme.php @@ -26,9 +26,9 @@ class Theme { */ static public function current() { - self::$system_theme = ((isset(App::$config['system']['theme'])) + self::$system_theme = ((!empty(App::$config['system']['theme'])) ? App::$config['system']['theme'] : ''); - self::$session_theme = ((isset($_SESSION) && x($_SESSION, 'theme')) + self::$session_theme = ((!empty($_SESSION['theme'])) ? $_SESSION['theme'] : self::$system_theme); $page_theme = null; @@ -87,8 +87,13 @@ class Theme { // Find any theme at all and use it. $fallback = array_merge(glob('view/theme/*/css/style.css'), glob('view/theme/*/php/style.php')); - if(count($fallback)) - return(array(str_replace('view/theme/', '', substr($fallback[0], 0, -14)))); + + if (empty($fallback)) { + logger('Unable to find a theme'); + http_status_exit(500, 'internal server error'); + } + + return(array(str_replace('view/theme/', '', substr($fallback[0], 0, -14)))); } @@ -111,7 +116,7 @@ class Theme { $opts = ''; $opts = (($uid) ? '?puid=' . $uid : ''); - $schema_str = ((x(App::$layout,'schema')) ? '&schema=' . App::$layout['schema'] : ''); + $schema_str = ((!empty(App::$layout['schema'])) ? '&schema=' . App::$layout['schema'] : ''); if(($s) && (! $schema_str)) $schema_str = '&schema=' . $s; |