diff --git a/xExtension-ImageProxy/README.md b/xExtension-ImageProxy/README.md index e58edc29..81ae273e 100644 --- a/xExtension-ImageProxy/README.md +++ b/xExtension-ImageProxy/README.md @@ -6,6 +6,7 @@ To use it, upload this entire directory to the FreshRSS `./extensions` directory ## Changelog +* 1.0.4 Respect the feed option to hide enclosures * 1.0.3 Proxy the poster images of videos * 1.0.1 Replace deprecated HTML entity conversion on PHP 8.2+ * 1.0 Breaking changes due to significant code upgrade: settings must be saved again diff --git a/xExtension-ImageProxy/extension.php b/xExtension-ImageProxy/extension.php index ebd056eb..4b35a07f 100644 --- a/xExtension-ImageProxy/extension.php +++ b/xExtension-ImageProxy/extension.php @@ -184,8 +184,11 @@ public static function swapUris(string $content): string { * @throws FreshRSS_Context_Exception */ public static function setImageProxyHook(FreshRSS_Entry $entry): FreshRSS_Entry { + // The enclosures become part of the content, so only include them if the feed displays them + // We most likely already have the feed object in cache, otherwise make a request + $feed = FreshRSS_Category::findFeed(FreshRSS_Context::categories(), $entry->feedId()) ?? $entry->feed(); $entry->_content( - self::swapUris($entry->content()) + self::swapUris($entry->content($feed?->attributeBoolean('display_enclosures') ?? true)) ); return $entry; diff --git a/xExtension-ImageProxy/metadata.json b/xExtension-ImageProxy/metadata.json index 9f9141c5..0663a117 100644 --- a/xExtension-ImageProxy/metadata.json +++ b/xExtension-ImageProxy/metadata.json @@ -2,7 +2,7 @@ "name": "Image Proxy", "author": "Frans de Jonge", "description": "No insecure content warnings or disappearing images.", - "version": "1.0.3", + "version": "1.0.4", "entrypoint": "ImageProxy", "type": "user" }