[js_upload] Fixing missing extension index #827

Merged
nupplaphil merged 3 commits from issue/6338-php_notices into 2019.03-RC 2019-03-14 03:50:58 +01:00

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