From 02d4659a3266929e69390abf224c16f1ce0b452a Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 22 Oct 2015 08:38:50 +0100 Subject: [PATCH] Initial (untested) image uploader. --- build/index.php | 242 +++++++++++++++++++++++++++++++++++++ core.php | 43 +++++++ module_index.json | 45 ++++--- modules/feature-upload.php | 96 ++++++++++++--- settings.fragment.php | 9 +- 5 files changed, 397 insertions(+), 38 deletions(-) diff --git a/build/index.php b/build/index.php index 595d60c..f4f8836 100644 --- a/build/index.php +++ b/build/index.php @@ -174,6 +174,25 @@ $settings->footer_message = "All content is under editing_message = "By submitting your edit, you are agreeing to release your changes under this license. Also note that if you don't want your work to be edited by other users of this site, please don't submit it here!"; +// Whether to allow image uploads to the server. Currently disabled temporarily +// for security reasons while I finish writing the file uploader. +$settings->upload_enabled = true; + +// An array of mime types that are allowed to be uploaded. +$settings->upload_allowed_file_types = [ + "image/jpeg", + "image/png", + "image/gif", + "image/webp" +]; + +// The location of a file that maps mime types onto file extensions and vice +// versa. Used to generate the file extension for an uploaded file. Set to the +// default location of the mime.types file on Linux. If you aren't using linux, +// download this pastebin and point this setting at it instead: +// http://pastebin.com/mjM3zKjz +$settings->mime_extension_mappings_location = "/etc/mime.types"; + // A string of css to include. Will be included in the of every page // inside a