diff options
author | Andrew Dolgov <[email protected]> | 2016-01-06 21:00:53 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-01-06 21:00:53 +0300 |
commit | c203486e040831881fd91db2cc3d8105214fa568 (patch) | |
tree | 80664e15e67d80f0efb3c820de006762ca6052ea /plugins/cache_starred_images/init.php | |
parent | 9b736a20b3367da2b58a279024ae6f8e39b1e41a (diff) |
cache_starred_images: set filename when sending cached image
Diffstat (limited to 'plugins/cache_starred_images/init.php')
-rw-r--r-- | plugins/cache_starred_images/init.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index f1341a350..63637bfd8 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') && |