mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 17:23:00 +00:00
Tweak the uploaded filename
This commit is contained in:
parent
093960133b
commit
fea2a8b004
3 changed files with 3 additions and 3 deletions
|
@ -1309,7 +1309,7 @@ register_module([
|
||||||
$file_extension = system_mime_type_extension($mime_type);
|
$file_extension = system_mime_type_extension($mime_type);
|
||||||
|
|
||||||
$new_filename = "Files/$target_name.$file_extension";
|
$new_filename = "Files/$target_name.$file_extension";
|
||||||
$new_description_filename = "Files/$target_name.md";
|
$new_description_filename = "$new_filename.md";
|
||||||
|
|
||||||
if(isset($pageindex->$new_filename))
|
if(isset($pageindex->$new_filename))
|
||||||
exit(page_renderer::render("Upload Error - $settings->sitename", "<p>A page or file has already been uploaded with the name '$new_filename'. Try deleting it first. If you do not have permission to delete things, try contacting one of the moderators.</p>"));
|
exit(page_renderer::render("Upload Error - $settings->sitename", "<p>A page or file has already been uploaded with the name '$new_filename'. Try deleting it first. If you do not have permission to delete things, try contacting one of the moderators.</p>"));
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
||||||
"id": "feature-upload",
|
"id": "feature-upload",
|
||||||
"lastupdate": 1445500347,
|
"lastupdate": 1445500627,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -88,7 +88,7 @@ register_module([
|
||||||
$file_extension = system_mime_type_extension($mime_type);
|
$file_extension = system_mime_type_extension($mime_type);
|
||||||
|
|
||||||
$new_filename = "Files/$target_name.$file_extension";
|
$new_filename = "Files/$target_name.$file_extension";
|
||||||
$new_description_filename = "Files/$target_name.md";
|
$new_description_filename = "$new_filename.md";
|
||||||
|
|
||||||
if(isset($pageindex->$new_filename))
|
if(isset($pageindex->$new_filename))
|
||||||
exit(page_renderer::render("Upload Error - $settings->sitename", "<p>A page or file has already been uploaded with the name '$new_filename'. Try deleting it first. If you do not have permission to delete things, try contacting one of the moderators.</p>"));
|
exit(page_renderer::render("Upload Error - $settings->sitename", "<p>A page or file has already been uploaded with the name '$new_filename'. Try deleting it first. If you do not have permission to delete things, try contacting one of the moderators.</p>"));
|
||||||
|
|
Loading…
Reference in a new issue