From a9b8eb4d56fbce6750f777a9b829263a5cfb22cf Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 12 Jan 2019 02:26:16 -0500 Subject: [PATCH] Refactor Theme::getStylesheetPath to return faster if theme style.php doesn't exist --- src/Core/Theme.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) : ''); } }