From 58210301e0e462ddfe9bd625865059d57a0c7cd7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 Feb 2017 16:01:28 +0300 Subject: add HOOK_ENCLOSURE_ENTRY for af_zz_imgproxy --- plugins/af_zz_imgproxy/init.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins') diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php index 6d7954c3c..923f81734 100644 --- a/plugins/af_zz_imgproxy/init.php +++ b/plugins/af_zz_imgproxy/init.php @@ -18,10 +18,19 @@ class Af_Zz_ImgProxy extends Plugin { $host->add_hook($host::HOOK_RENDER_ARTICLE, $this); $host->add_hook($host::HOOK_RENDER_ARTICLE_CDM, $this); $host->add_hook($host::HOOK_RENDER_ARTICLE_API, $this); + $host->add_hook($host::HOOK_ENCLOSURE_ENTRY, $this); $host->add_hook($host::HOOK_PREFS_TAB, $this); } + function hook_enclosure_entry($enc) { + $proxy_all = $this->host->get($this, "proxy_all"); + + $enc["url"] = $this->rewrite_url_if_needed($enc["url"], $proxy_all); + + return $enc; + } + function hook_render_article($article) { return $this->hook_render_article_cdm($article); } -- cgit v1.2.3-54-g00ecf