From 95ebe737bd9db0f3062f15bc79e37abe3f6faae5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 25 Feb 2015 21:16:14 +0300 Subject: [PATCH] cache_starred_images: route images to public.php --- plugins/cache_starred_images/init.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index 4e5f2d4f7..b851479c0 100644 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -1,5 +1,5 @@ host = $host; @@ -29,6 +41,8 @@ class Cache_Starred_Images extends Plugin { $host->add_hook($host::HOOK_UPDATE_TASK, $this); $host->add_hook($host::HOOK_HOUSE_KEEPING, $this); $host->add_hook($host::HOOK_SANITIZE, $this); + $host->add_handler("public", "cache_starred_images_getimage", $this); + } else { user_error("Starred cache directory is not writable.", E_USER_WARNING); } @@ -38,7 +52,7 @@ class Cache_Starred_Images extends Plugin { } } - function image() { + function cache_starred_images_getimage() { ob_end_clean(); $hash = basename($_REQUEST["hash"]); @@ -109,7 +123,7 @@ class Cache_Starred_Images extends Plugin { if (file_exists($local_filename)) { $entry->setAttribute("src", get_self_url_prefix() . - "/backend.php?op=pluginhandler&plugin=cache_starred_images&method=image&hash=" . + "/public.php?op=cache_starred_images_getimage&method=image&hash=" . $article_id . "-" . sha1($src)); }