diff options
| author | 2024-09-20 23:25:38 +0200 | |
|---|---|---|
| committer | 2024-09-20 23:25:38 +0200 | |
| commit | ffc3d393e52e3c0d62e23dbd6fdc8fe695ca96ee (patch) | |
| tree | 816269f95975896b4151392fc29f3f7360157df7 /lib/lib_rss.php | |
| parent | dd606141555880822ad9ae650bd2bb68cbb01692 (diff) | |
SimplePie support for HTTP cache policies (#6812)
* SimplePie support for HTTP cache policies
Discussion in https://github.com/FreshRSS/simplepie/pull/26
* Bump SimplePie commit
* Typos
* Typos
* Simpler logic
* Explicitly disable cache for non-GET flows
* Bump SimplePie commit
* Bump SimplePie commit
* Bump SimplePie commit
* Bump SimplePie commit
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 2f1f4e3ef..32139d8c8 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -282,7 +282,7 @@ function customSimplePie(array $attributes = [], array $curl_options = []): \Sim $simplePie->set_useragent(FRESHRSS_USERAGENT); $simplePie->set_cache_name_function('sha1'); $simplePie->set_cache_location(CACHE_PATH); - $simplePie->set_cache_duration($limits['cache_duration']); + $simplePie->set_cache_duration($limits['cache_duration'], $limits['cache_duration_min'], $limits['cache_duration_max']); $simplePie->enable_order_by_date(false); $feed_timeout = empty($attributes['timeout']) || !is_numeric($attributes['timeout']) ? 0 : (int)$attributes['timeout']; @@ -369,6 +369,7 @@ function sanitizeHTML(string $data, string $base = '', ?int $maxLength = null): static $simplePie = null; if ($simplePie == null) { $simplePie = customSimplePie(); + $simplePie->enable_cache(false); $simplePie->init(); } $result = html_only_entity_decode($simplePie->sanitize->sanitize($data, \SimplePie\SimplePie::CONSTRUCT_HTML, $base)); |
