From: Hypolite Petovan Date: Sat, 12 Jan 2019 07:26:16 +0000 (-0500) Subject: Refactor Theme::getStylesheetPath to return faster if theme style.php doesn't exist X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a9b8eb4d56fbce6750f777a9b829263a5cfb22cf;p=friendica.git Refactor Theme::getStylesheetPath to return faster if theme style.php doesn't exist --- diff --git a/src/Core/Theme.php b/src/Core/Theme.php index 2202780376..de8cd496a4 100644 --- a/src/Core/Theme.php +++ b/src/Core/Theme.php @@ -193,6 +193,10 @@ class Theme */ public static function getStylesheetPath($theme) { + if (!file_exists('view/theme/' . $theme . '/style.php')) { + return 'view/theme/' . $theme . '/style.css'; + } + $a = BaseObject::getApp(); $query_params = []; @@ -202,10 +206,6 @@ class Theme $query_params['puid'] = $puid; } - if (file_exists('view/theme/' . $theme . '/style.php')) { - return 'view/theme/' . $theme . '/style.pcss' . (!empty($query_params) ? '?' . http_build_query($query_params) : ''); - } - - return 'view/theme/' . $theme . '/style.css'; + return 'view/theme/' . $theme . '/style.pcss' . (!empty($query_params) ? '?' . http_build_query($query_params) : ''); } }