From 703351c79e86cc6bb357bd40f7dc75a7da1e7a51 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Dec 2018 11:37:26 +0300 Subject: remove theme supports-version etc checking --- include/functions.php | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 2b6ad50e4..8d0b703f7 100755 --- a/include/functions.php +++ b/include/functions.php @@ -1078,7 +1078,7 @@ $params["label_base_index"] = (int) LABEL_BASE_INDEX; $theme = get_pref( "USER_CSS_THEME", false, false); - $params["theme"] = theme_valid("$theme") ? $theme : ""; + $params["theme"] = theme_exists($theme) ? $theme : ""; $params["plugins"] = implode(", ", PluginHost::getInstance()->get_plugin_names()); @@ -2442,27 +2442,8 @@ if (file_exists($check)) return $check; } - function theme_valid($theme) { - $bundled_themes = [ "night.css", "compact.css" ]; - - if (in_array($theme, $bundled_themes)) return true; - - $file = "themes/" . basename($theme); - - if (!file_exists($file)) $file = "themes.local/" . basename($theme); - - if (file_exists($file) && is_readable($file)) { - $fh = fopen($file, "r"); - - if ($fh) { - $header = fgets($fh); - fclose($fh); - - return strpos($header, "supports-version:" . VERSION_STATIC) !== FALSE; - } - } - - return false; + function theme_exists($theme) { + return file_exists("themes/$theme") || file_exists("themes.local/$theme"); } /** -- cgit v1.2.3