diff options
| author | Andrew Dolgov <noreply@fakecake.org> | 2017-02-12 17:32:43 +0300 |
|---|---|---|
| committer | Andrew Dolgov <noreply@fakecake.org> | 2017-02-12 17:32:43 +0300 |
| commit | bc83dcb381b56f8038eec15d8bb0f195bc31c388 (patch) | |
| tree | 3d8edde449cbe37c2616f73012f190c81a841c3e | |
| parent | 676c7303ca1aec697a0296344bf10a6066dcea1a (diff) | |
af_zz_imgproxy: limit enclosure rewriting to images
| -rw-r--r-- | plugins/af_zz_imgproxy/init.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php index bfa44a3b1..9ef813ce8 100644 --- a/plugins/af_zz_imgproxy/init.php +++ b/plugins/af_zz_imgproxy/init.php @@ -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; } |