mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-21 16:13:00 +00:00
Squash a warning when uploading a file
This commit is contained in:
parent
712e95474c
commit
a5572bcbd4
2 changed files with 3 additions and 2 deletions
|
@ -12,6 +12,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
|
|||
- Consolidated `email` and `emailAddress` fields into the latter in the user table (#167)
|
||||
- Fixed a crash when trying to access the user table when not logged in as an administrator.
|
||||
- Fixed help text for the file upload module
|
||||
- Squashed a warning when uploading a file
|
||||
|
||||
### Added
|
||||
- [Module API] Added new extra data system. See `parser-parsedown` and `page-edit` for an example.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
register_module([
|
||||
"name" => "Uploader",
|
||||
"version" => "0.5.16",
|
||||
"version" => "0.5.17",
|
||||
"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",
|
||||
|
@ -108,7 +108,7 @@ register_module([
|
|||
// Make sure uploads are enabled
|
||||
if(!$settings->upload_enabled)
|
||||
{
|
||||
if(!empty($_FILES["file"]))
|
||||
if(!empty($_FILES["file"]) && file_exists($_FILES["file"]["tmp_name"]))
|
||||
unlink($_FILES["file"]["tmp_name"]);
|
||||
http_response_code(412);
|
||||
exit(page_renderer::render("Upload failed - $settings->sitename", "<p>Your upload couldn't be processed because uploads are currently disabled on $settings->sitename. <a href='index.php'>Go back to the main page</a>.</p>"));
|
||||
|
|
Loading…
Reference in a new issue