Use mime-type array when checking for acceptable extensions
This commit is contained in:
parent
7ce3082fa2
commit
27fe32a3b4
|
@ -149,7 +149,7 @@ class CcFiles extends BaseCcFiles {
|
|||
|
||||
//Only accept files with a file extension that we support.
|
||||
$fileExtension = pathinfo($originalFilename, PATHINFO_EXTENSION);
|
||||
if (!in_array(strtolower($fileExtension), explode(",", "ogg,mp3,oga,flac,wav,m4a,mp4,opus"))) {
|
||||
if (!in_array(strtolower($fileExtension), array_values(FileDataHelper::getAudioMimeTypeArray()))) {
|
||||
throw new Exception("Bad file extension.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue