]> git.mxchange.org Git - friendica-addons.git/commitdiff
JS Uploader: "jpg" added to the list of allowed file extensions
authorMichael <heluecht@pirati.ca>
Sun, 16 Jun 2024 14:35:19 +0000 (14:35 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 16 Jun 2024 14:35:19 +0000 (14:35 +0000)
js_upload/js_upload.php

index 786fc3c2d6783a98f3d119109dc7e7fb86aab69c..0d045deee5d557928bbfab8616d2c95b2487dd1e 100644 (file)
@@ -50,7 +50,11 @@ function js_upload_post_init(array &$b)
        // list of valid extensions
        $allowedExtensions = [];
        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
@@ -216,9 +220,9 @@ class qqFileUploader
                        return ['error' => DI::l10n()->t('Uploaded file is empty')];
                }
 
-//             if ($size > $this->sizeLimit) {
-//                     return array('error' => DI::l10n()->t('Uploaded file is too large'));
-//             }
+               //              if ($size > $this->sizeLimit) {
+               //                      return array('error' => DI::l10n()->t('Uploaded file is too large'));
+               //              }
 
                $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));