From: Andrew Dolgov Date: Thu, 23 Mar 2017 12:22:00 +0000 (+0300) Subject: when choosing enclosures to embed or rewrite (af_zz_imgproxy) only use content type... X-Git-Tag: 17.4~11 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dc2c4b13d41d0e243a4da3ef4534de3cb645ec89;p=tt-rss.git when choosing enclosures to embed or rewrite (af_zz_imgproxy) only use content type instead of "filename"-based hacks --- diff --git a/include/functions2.php b/include/functions2.php index e00a0ba1..28e182f8 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -2000,8 +2000,7 @@ $rv .= $retval; } else { - if (preg_match("/image/", $entry["type"]) || - preg_match("/\.(jpe?g|png|gif|bmp)/i", $entry["filename"])) { + if (preg_match("/image/", $entry["type"])) { if (!$hide_images) { $encsize = ''; diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php index e0ec2f17..a07ff561 100644 --- a/plugins/af_zz_imgproxy/init.php +++ b/plugins/af_zz_imgproxy/init.php @@ -23,7 +23,7 @@ class Af_Zz_ImgProxy extends Plugin { } function hook_enclosure_entry($enc) { - if (preg_match("/image/", $enc["content_type"]) || preg_match("/\.(jpe?g|png|gif|bmp)$/i", $enc["filename"])) { + if (preg_match("/image/", $enc["content_type"])) { $proxy_all = $this->host->get($this, "proxy_all"); $enc["content_url"] = $this->rewrite_url_if_needed($enc["content_url"], $proxy_all);