From: Andrew Dolgov Date: Wed, 6 Jan 2016 18:00:53 +0000 (+0300) Subject: cache_starred_images: set filename when sending cached image X-Git-Tag: 16.3~62 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=c203486e040831881fd91db2cc3d8105214fa568 cache_starred_images: set filename when sending cached image --- diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index f1341a35..63637bfd 100644 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -59,10 +59,12 @@ class Cache_Starred_Images extends Plugin implements IHandler { if ($hash) { - $filename = $this->cache_dir . "/" . $hash; + $filename = $this->cache_dir . "/" . basename($hash); $is_video = strpos($filename, ".mp4") !== FALSE; if (file_exists($filename)) { + header("Content-Disposition: attachment; filename=\"$hash\""); + /* See if we can use X-Sendfile */ $xsendfile = false; if (function_exists('apache_get_modules') &&