From ffc3d393e52e3c0d62e23dbd6fdc8fe695ca96ee Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 20 Sep 2024 23:25:38 +0200 Subject: 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 --- lib/lib_rss.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/lib_rss.php') 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)); -- cgit v1.2.3