]> git.wh0rd.org - tt-rss.git/commitdiff
cache_starred_images: set filename when sending cached image
authorAndrew Dolgov <noreply@fakecake.org>
Wed, 6 Jan 2016 18:00:53 +0000 (21:00 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Wed, 6 Jan 2016 18:00:53 +0000 (21:00 +0300)
plugins/cache_starred_images/init.php

index f1341a35078d884267c131beb59e4f0779eb46a5..63637bfd8743820e6cb829d320635d394a94cd73 100644 (file)
@@ -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') &&