Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions xExtension-ImageProxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion xExtension-ImageProxy/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion xExtension-ImageProxy/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}