summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-09 11:37:26 +0300
committerAndrew Dolgov <[email protected]>2018-12-09 11:37:26 +0300
commit703351c79e86cc6bb357bd40f7dc75a7da1e7a51 (patch)
treeee941bbe31581f607997aa977261b19e37624dc7 /include
parentb2c079893bbd783193fd212db435f5e6ebc8b094 (diff)
remove theme supports-version etc checking
Diffstat (limited to 'include')
-rwxr-xr-xinclude/functions.php25
1 files changed, 3 insertions, 22 deletions
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");
}
/**