From fea2a8b0044bbb7ae77664a895e5e3b3d6c1d98d Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 22 Oct 2015 08:59:03 +0100 Subject: [PATCH] Tweak the uploaded filename --- build/index.php | 2 +- module_index.json | 2 +- modules/feature-upload.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/index.php b/build/index.php index 540b7a7..82a2019 100644 --- a/build/index.php +++ b/build/index.php @@ -1309,7 +1309,7 @@ register_module([ $file_extension = system_mime_type_extension($mime_type); $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)) exit(page_renderer::render("Upload Error - $settings->sitename", "

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.

")); diff --git a/module_index.json b/module_index.json index 9e4316c..55ccbf1 100644 --- a/module_index.json +++ b/module_index.json @@ -50,7 +50,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": 1445500347, + "lastupdate": 1445500627, "optional": false }, { diff --git a/modules/feature-upload.php b/modules/feature-upload.php index fdae758..3d998b5 100644 --- a/modules/feature-upload.php +++ b/modules/feature-upload.php @@ -88,7 +88,7 @@ register_module([ $file_extension = system_mime_type_extension($mime_type); $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)) exit(page_renderer::render("Upload Error - $settings->sitename", "

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.

"));