1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 21:45:55 +00:00

remove theme supports-version etc checking

This commit is contained in:
Andrew Dolgov
2018-12-09 11:37:26 +03:00
parent b2c079893b
commit 703351c79e
4 changed files with 7 additions and 26 deletions

View File

@@ -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");
}
/**