mirror of
https://github.com/friendica/friendica
synced 2024-11-09 17:02:54 +00:00
Merge pull request #14404 from annando/error
Fix exception "($shorthand) must be of type string, null given,"
This commit is contained in:
commit
dc145bb440
2 changed files with 4 additions and 4 deletions
|
@ -71,7 +71,7 @@ class Instance extends BaseApi
|
|||
$this->config->get('config', 'max_import_size')
|
||||
), 99, 23);
|
||||
|
||||
$image_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maximagesize'));
|
||||
$image_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maximagesize') ?? 0);
|
||||
$max_image_length = $this->config->get('system', 'max_image_length');
|
||||
if ($max_image_length > 0) {
|
||||
$image_matrix_limit = pow($max_image_length, 2);
|
||||
|
@ -79,7 +79,7 @@ class Instance extends BaseApi
|
|||
$image_matrix_limit = 33177600; // 5760^2
|
||||
}
|
||||
|
||||
$media_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maxfilesize'));
|
||||
$media_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maxfilesize') ?? 0);
|
||||
if (empty($media_size_limit)) {
|
||||
$media_size_limit = Strings::getBytesFromShorthand(ini_get('upload_max_filesize'));
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class InstanceV2 extends BaseApi
|
|||
$this->config->get('config', 'max_import_size')
|
||||
), 99, 23);
|
||||
|
||||
$image_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maximagesize'));
|
||||
$image_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maximagesize') ?? 0);
|
||||
$max_image_length = $this->config->get('system', 'max_image_length');
|
||||
if ($max_image_length > 0) {
|
||||
$image_matrix_limit = pow($max_image_length, 2);
|
||||
|
@ -115,7 +115,7 @@ class InstanceV2 extends BaseApi
|
|||
$image_matrix_limit = 33177600; // 5760^2
|
||||
}
|
||||
|
||||
$media_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maxfilesize'));
|
||||
$media_size_limit = Strings::getBytesFromShorthand($this->config->get('system', 'maxfilesize') ?? 0);
|
||||
if (empty($media_size_limit)) {
|
||||
$media_size_limit = Strings::getBytesFromShorthand(ini_get('upload_max_filesize'));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue