Skip to content

Commit

Permalink
Merge pull request #27 from dmstr/feature/undefined-variable-fix
Browse files Browse the repository at this point in the history
Fixed undefined variable in upload action
  • Loading branch information
schmunk42 authored Jul 22, 2022
2 parents 8799508 + e838f17 commit 7aab89a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,10 @@ public function actionUpload($path)
$fullPath = $path . trim($file['name'], '/');
}

$uploaded = false;
try {
$mimeTypes = \Yii::$app->settings->get('mime-whitelist', 'filefly');
empty($mimeTypes) ? $acceptedMimeTypes = [] : $acceptedMimeTypes = explode(",", $mimeTypes);
$acceptedMimeTypes = empty($mimeTypes) ? [] : explode(",", $mimeTypes);

if (in_array(mime_content_type($file['tmp_name']), $acceptedMimeTypes,
false) || empty($acceptedMimeTypes)) {
Expand Down

0 comments on commit 7aab89a

Please sign in to comment.