1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-04 05:07:44 +02:00

Version 1.5.3.3: Fix language files and editable file upload size

This commit is contained in:
trendschau
2022-06-12 22:34:06 +02:00
parent 9688011d98
commit 2fb6dd6d47
13 changed files with 54 additions and 40 deletions

View File

@@ -237,10 +237,12 @@ class ControllerAuthorMediaApi extends ControllerAuthor
return $response->withJson(['errors' => 'File is empty.'],422);
}
$maxUploadSize = (isset($this->settings['maxuploadsize']) && is_numeric($this->settings['maxuploadsize']) ) ? ( $this->settings['maxuploadsize'] * 1024 * 1024) : 20971520;
# 20 MB (1 byte * 1024 * 1024 * 20 (for 20 MB))
if ($size > 20971520)
if ($size > $maxUploadSize)
{
return $response->withJson(['errors' => 'File is bigger than 20MB.'],422);
return $response->withJson(['errors' => 'File is bigger than '. ($maxUploadSize / 1024 / 1024) .'MB.'],422);
}
# check extension first

View File

@@ -121,6 +121,7 @@ class ControllerSettings extends ControllerShared
'oldslug' => isset($newSettings['oldslug']) ? true : null,
'refreshcache' => isset($newSettings['refreshcache']) ? true : null,
'pingsitemap' => isset($newSettings['pingsitemap']) ? true : null,
'maxuploadsize' => $newSettings['maxuploadsize'],
);
# https://www.slimframework.com/docs/v3/cookbook/uploading-files.html;