]> git.wh0rd.org - tt-rss.git/blobdiff - plugins/af_zz_imgproxy/init.php
af_zz_imgproxy: limit enclosure rewriting to images
[tt-rss.git] / plugins / af_zz_imgproxy / init.php
index bfa44a3b17449e0759d8a17a7f6e5e25e96c1307..9ef813ce81f50154c3bc9ef26806fe9bfb637fd7 100644 (file)
@@ -24,9 +24,11 @@ class Af_Zz_ImgProxy extends Plugin {
        }
 
        function hook_enclosure_entry($enc) {
-               $proxy_all = $this->host->get($this, "proxy_all");
+               if (preg_match("/image/", $enc["type"]) || preg_match("/\.(jpg|png|gif|bmp)/i", $enc["filename"])) {
+                       $proxy_all = $this->host->get($this, "proxy_all");
 
-               $enc["content_url"] = $this->rewrite_url_if_needed($enc["content_url"], $proxy_all);
+                       $enc["content_url"] = $this->rewrite_url_if_needed($enc["content_url"], $proxy_all);
+               }
 
                return $enc;
        }