Merge pull request #827 from nupplaphil/issue/6338-php_notices

[js_upload] Fixing missing extension index
This commit is contained in:
Hypolite Petovan 2019-03-13 22:50:57 -04:00 committed by GitHub
commit c5ba1cae69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@
* Module Author: Chris Case * Module Author: Chris Case
* *
*/ */
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -333,7 +334,10 @@ class qqFileUploader {
$pathinfo = pathinfo($this->file->getName()); $pathinfo = pathinfo($this->file->getName());
$filename = $pathinfo['filename']; $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)){ if($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)){
$these = implode(', ', $this->allowedExtensions); $these = implode(', ', $this->allowedExtensions);