From: Philipp Holzer Date: Wed, 13 Mar 2019 19:54:18 +0000 (+0100) Subject: Fixing missing extension index in js_upload X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=47b2326dff34401883eac877bed4493d05a9cbf0;p=friendica-addons.git Fixing missing extension index in js_upload --- diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index b115e961..22948b1c 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -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);