summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-08-16 12:16:51 +0300
committerAndrew Dolgov <[email protected]>2018-08-16 12:16:51 +0300
commit88adf3da1b8ed0ecc3bb17d34d2322e344cb06a6 (patch)
treed07010d96be07a8a92c6042fa2de791e9d9d5e79 /classes
parent163b50b15f3b163a392327692aede68e31a6204e (diff)
send_local_file: add application/octet-stream hack
cached_url: return original requested filename to save as
Diffstat (limited to 'classes')
-rwxr-xr-x[-rw-r--r--]classes/handler/public.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index 8440bc355..e892a9797 100644..100755
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -934,17 +934,17 @@ class Handler_Public extends Handler {
}
function cached_url() {
- @$hash = basename($_GET['hash']);
+ @$req_filename = basename($_GET['hash']);
// we don't need an extension to find the file, hash is a complete URL
- $hash = preg_replace("/\.[^\.]*$/", "", $hash);
+ $hash = preg_replace("/\.[^\.]*$/", "", $req_filename);
if ($hash) {
$filename = CACHE_DIR . '/images/' . $hash;
if (file_exists($filename)) {
- header("Content-Disposition: inline; filename=\"$hash\"");
+ header("Content-Disposition: inline; filename=\"$req_filename\"");
send_local_file($filename);