aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-09-06 08:51:21 +0200
committerGravatar GitHub <noreply@github.com> 2024-09-06 08:51:21 +0200
commita6138225ea7863471ec66e3f51ab3192ac8a1112 (patch)
tree559d6a1f26a444bc67ae9a0237ff47f6790a2474 /app
parent2cd9130726dec007e856d2c21916e6cd748d0537 (diff)
Better cache name for JSON feeds (#6768)
Diffstat (limited to 'app')
-rw-r--r--app/Models/Feed.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 50495a361..36cc58cfd 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -905,12 +905,19 @@ class FreshRSS_Feed extends Minz_Model {
}
$url = htmlspecialchars_decode($this->url);
$filename = $simplePie->get_cache_filename($url);
- if ($this->kind === FreshRSS_Feed::KIND_HTML_XPATH) {
- return CACHE_PATH . '/' . $filename . '.html';
- } elseif ($this->kind === FreshRSS_Feed::KIND_XML_XPATH) {
- return CACHE_PATH . '/' . $filename . '.xml';
- } else {
- return CACHE_PATH . '/' . $filename . '.spc';
+ switch ($this->kind) {
+ case FreshRSS_Feed::KIND_HTML_XPATH:
+ return CACHE_PATH . '/' . $filename . '.html';
+ case FreshRSS_Feed::KIND_XML_XPATH:
+ return CACHE_PATH . '/' . $filename . '.xml';
+ case FreshRSS_Feed::KIND_JSON_DOTNOTATION:
+ case FreshRSS_Feed::KIND_JSON_XPATH:
+ case FreshRSS_Feed::KIND_JSONFEED:
+ return CACHE_PATH . '/' . $filename . '.json';
+ case FreshRSS_Feed::KIND_RSS:
+ case FreshRSS_Feed::KIND_RSS_FORCED:
+ default:
+ return CACHE_PATH . '/' . $filename . '.spc';
}
}