Fixing missing extension index in js_upload

This commit is contained in:
Philipp Holzer 2019-03-13 20:54:18 +01:00
parent e8633a6c3d
commit 47b2326dff
No known key found for this signature in database
GPG Key ID: 517BE60E2CE5C8A5

View 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);