diff --git a/xExtension-ImageProxy/extension.php b/xExtension-ImageProxy/extension.php index 8ef62db..1dd1494 100644 --- a/xExtension-ImageProxy/extension.php +++ b/xExtension-ImageProxy/extension.php @@ -121,7 +121,7 @@ public static function swapUris(string $content): string { $doc = new DOMDocument(); libxml_use_internal_errors(true); // prevent tag soup errors from showing - $doc->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + $doc->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')); $imgs = $doc->getElementsByTagName('img'); foreach ($imgs as $img) { if ($img->hasAttribute('src')) { @@ -136,7 +136,13 @@ public static function swapUris(string $content): string { } } - return $doc->saveHTML() ?: ''; + $body = $doc->getElementsByTagName('body')->item(0); + + $output = $doc->saveHTML($body); + + $output = preg_replace('/^|<\/body>$/', '', $output); + + return $output; } public static function setImageProxyHook(FreshRSS_Entry $entry): FreshRSS_Entry { diff --git a/xExtension-ImageProxy/metadata.json b/xExtension-ImageProxy/metadata.json index 621caa8..dfd761b 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": "0.7", + "version": "0.7.1", "entrypoint": "ImageProxy", "type": "user" }