]> git.mxchange.org Git - friendica-addons.git/commitdiff
Fixing missing extension index in js_upload
authorPhilipp Holzer <admin@philipp.info>
Wed, 13 Mar 2019 19:54:18 +0000 (20:54 +0100)
committerPhilipp Holzer <admin@philipp.info>
Wed, 13 Mar 2019 19:54:18 +0000 (20:54 +0100)
js_upload/js_upload.php

index b115e961eec3fddce1439b9bddd16d462e9c5619..22948b1c7bda68f28093039bf38356fc95a526ec 100644 (file)
@@ -14,6 +14,7 @@
  * Module Author: Chris Case
  *
  */
+
 use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
@@ -333,7 +334,10 @@ class qqFileUploader {
         $pathinfo = pathinfo($this->file->getName());
         $filename = $pathinfo['filename'];
 
-        $ext = $pathinfo['extension'];
+        if (!isset($pathinfo['extension'])) {
+               Logger::warning('extension isn\'t set.', ['filename' => $filename]);
+               }
+        $ext = defaults($pathinfo, 'extension', '');
 
         if($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)){
             $these = implode(', ', $this->allowedExtensions);