mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Suggest appropriate filename when saving a generated preview image. Fixes #105.
This commit is contained in:
parent
673fe033ee
commit
06a3a4a19f
3 changed files with 7 additions and 1 deletions
|
@ -2969,6 +2969,9 @@ register_module([
|
|||
|
||||
$filepath = $env->storage_prefix . $pageindex->{$env->page}->uploadedfilepath;
|
||||
$mime_type = $pageindex->{$env->page}->uploadedfilemime;
|
||||
$shortFilename = substr($filepath, 1 + (strrpos($filepath, '/') !== false ? strrpos($filepath, '/') : -1));
|
||||
|
||||
header("content-disposition: inline; filename=\"$shortFilename\"");
|
||||
|
||||
// If the size is set or original, then send (or redirect to) the original image
|
||||
// Also do the same for SVGs if svg rendering is disabled.
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
"author": "Starbeamrainbowlabs",
|
||||
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
|
||||
"id": "feature-upload",
|
||||
"lastupdate": 1476813024,
|
||||
"lastupdate": 1476813240,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -245,6 +245,9 @@ register_module([
|
|||
|
||||
$filepath = $env->storage_prefix . $pageindex->{$env->page}->uploadedfilepath;
|
||||
$mime_type = $pageindex->{$env->page}->uploadedfilemime;
|
||||
$shortFilename = substr($filepath, 1 + (strrpos($filepath, '/') !== false ? strrpos($filepath, '/') : -1));
|
||||
|
||||
header("content-disposition: inline; filename=\"$shortFilename\"");
|
||||
|
||||
// If the size is set or original, then send (or redirect to) the original image
|
||||
// Also do the same for SVGs if svg rendering is disabled.
|
||||
|
|
Loading…
Reference in a new issue