aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Themes.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/Themes.php')
-rw-r--r--app/Models/Themes.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/Models/Themes.php b/app/Models/Themes.php
index 2b5bff2f7..ef44b0b75 100644
--- a/app/Models/Themes.php
+++ b/app/Models/Themes.php
@@ -20,19 +20,21 @@ class FreshRSS_Themes extends Minz_Model {
$themes_list = self::getList();
$list = [];
foreach ($themes_list as $theme_dir) {
- $theme = self::get_infos($theme_dir);
+ $theme_id = rawurlencode($theme_dir);
+ $theme = self::get_infos($theme_id);
if (is_array($theme) && trim($theme['name']) !== '') {
- $list[$theme_dir] = $theme;
+ $list[$theme_id] = $theme;
}
}
return $list;
}
/**
+ * @param string $theme_id is the rawurlencode'd theme directory name
* @return false|array{id:string,name:string,author:string,description:string,version:float|string,files:array<string>,theme-color?:string|array{dark?:string,light?:string,default?:string}}
*/
public static function get_infos(string $theme_id): array|false {
- $theme_dir = PUBLIC_PATH . self::$themesUrl . $theme_id;
+ $theme_dir = PUBLIC_PATH . self::$themesUrl . rawurldecode($theme_id);
if (is_dir($theme_dir)) {
$json_filename = $theme_dir . '/metadata.json';
if (file_exists($json_filename)) {
@@ -55,6 +57,7 @@ class FreshRSS_Themes extends Minz_Model {
'default' => is_string($res['theme-color']['default'] ?? null) ? $res['theme-color']['default'] : '',
];
}
+ $result = Minz_Helper::htmlspecialchars_utf8($result);
return $result;
}
}