forked from friendica/friendica-addons
Merge pull request 'JS Uploader: "jpg" added to the list of allowed file extensions' (#1515) from heluecht/friendica-addons:jsupload into 2024.06-rc
Reviewed-on: friendica/friendica-addons#1515
This commit is contained in:
commit
ed07c987a6
1 changed files with 8 additions and 4 deletions
|
@ -50,7 +50,11 @@ function js_upload_post_init(array &$b)
|
||||||
// list of valid extensions
|
// list of valid extensions
|
||||||
$allowedExtensions = [];
|
$allowedExtensions = [];
|
||||||
foreach (Images::IMAGETYPES as $type) {
|
foreach (Images::IMAGETYPES as $type) {
|
||||||
$allowedExtensions[] = image_type_to_extension($type, false);
|
$extension = image_type_to_extension($type, false);
|
||||||
|
if ($extension == 'jpeg') {
|
||||||
|
$allowedExtensions[] = 'jpg';
|
||||||
|
}
|
||||||
|
$allowedExtensions[] = $extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
// max file size in bytes
|
// max file size in bytes
|
||||||
|
@ -216,9 +220,9 @@ class qqFileUploader
|
||||||
return ['error' => DI::l10n()->t('Uploaded file is empty')];
|
return ['error' => DI::l10n()->t('Uploaded file is empty')];
|
||||||
}
|
}
|
||||||
|
|
||||||
// if ($size > $this->sizeLimit) {
|
// if ($size > $this->sizeLimit) {
|
||||||
// return array('error' => DI::l10n()->t('Uploaded file is too large'));
|
// return array('error' => DI::l10n()->t('Uploaded file is too large'));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
|
$maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue