mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-23 01:55:01 +00:00
patching PHP 7.3.11 issue and double dot in file uploads
This commit is contained in:
parent
8d2179e290
commit
b1ebaaab61
2 changed files with 133 additions and 133 deletions
|
@ -13,7 +13,7 @@ register_module([
|
||||||
* @apiGroup Upload
|
* @apiGroup Upload
|
||||||
* @apiPermission User
|
* @apiPermission User
|
||||||
*
|
*
|
||||||
* @apiParam {boolean} avatar Optional. If true then a special page to upload your avatar is displayed instead.
|
* @apiParam {bool} avatar Optional. If true then a special page to upload your avatar is displayed instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,7 +25,7 @@ register_module([
|
||||||
* @apiParam {string} name The name of the file to upload.
|
* @apiParam {string} name The name of the file to upload.
|
||||||
* @apiParam {string} description A description of the file.
|
* @apiParam {string} description A description of the file.
|
||||||
* @apiParam {file} file The file to upload.
|
* @apiParam {file} file The file to upload.
|
||||||
* @apiParam {boolean} avatar Whether this upload should be uploaded as the current user's avatar. If specified, any filenames provided will be ignored.
|
* @apiParam {bool} avatar Whether this upload should be uploaded as the current user's avatar. If specified, any filenames provided will be ignored.
|
||||||
*
|
*
|
||||||
* @apiUse UserNotLoggedInError
|
* @apiUse UserNotLoggedInError
|
||||||
* @apiError UploadsDisabledError Uploads are currently disabled in the wiki's settings.
|
* @apiError UploadsDisabledError Uploads are currently disabled in the wiki's settings.
|
||||||
|
@ -99,7 +99,7 @@ register_module([
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "POST":
|
case "POST":
|
||||||
// Recieve file
|
// Receive file
|
||||||
|
|
||||||
if(!$settings->editing) {
|
if(!$settings->editing) {
|
||||||
exit(page_renderer::render_main("Upload failed - $settings->sitename", "<p>Your upload couldn't be processed because editing is currently disabled on $settings->sitename. Please contact $settings->admindetails_name, $settings->sitename's administrator for more information - their contact details can be found at the bottom of this page. <a href='index.php'>Go back to the main page</a>."));
|
exit(page_renderer::render_main("Upload failed - $settings->sitename", "<p>Your upload couldn't be processed because editing is currently disabled on $settings->sitename. Please contact $settings->admindetails_name, $settings->sitename's administrator for more information - their contact details can be found at the bottom of this page. <a href='index.php'>Go back to the main page</a>."));
|
||||||
|
@ -194,7 +194,7 @@ register_module([
|
||||||
|
|
||||||
// The path to the place (relative to the wiki data root)
|
// The path to the place (relative to the wiki data root)
|
||||||
// that we're actually going to store the uploaded file itself
|
// that we're actually going to store the uploaded file itself
|
||||||
$new_filename = "$paths->upload_file_prefix$target_name.$file_extension";
|
$new_filename = "$paths->upload_file_prefix$target_name$file_extension";
|
||||||
// The path (relative, as before) to the description file
|
// The path (relative, as before) to the description file
|
||||||
$new_description_filename = "$new_filename.md";
|
$new_description_filename = "$new_filename.md";
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ function do_password_hash_code_update() {
|
||||||
global $settings, $paths;
|
global $settings, $paths;
|
||||||
|
|
||||||
// There's no point if we're using Argon2i, as it doesn't take a cost
|
// There's no point if we're using Argon2i, as it doesn't take a cost
|
||||||
if(hash_password_properties()["algorithm"] == PASSWORD_ARGON2I)
|
if(defined("PASSWORD_ARGON2I") && hash_password_properties()["algorithm"] == PASSWORD_ARGON2I)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Skip rechecking if the automatic check has been disabled
|
// Skip rechecking if the automatic check has been disabled
|
||||||
|
|
Loading…
Reference in a new issue