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:
@@ -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
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user