parent
5cd2c5263e
commit
060fb9d24b
|
@ -27,6 +27,14 @@ class FileDataHelper
|
|||
];
|
||||
}
|
||||
|
||||
public static function getUploadAudioMimeTypeArray()
|
||||
{
|
||||
$mimes = self::getAudioMimeTypeArray();
|
||||
unset($mimes['audio/x-ms-wma']);
|
||||
|
||||
return $mimes;
|
||||
}
|
||||
|
||||
/**
|
||||
* We want to throw out invalid data and process the upload successfully
|
||||
* at all costs, so check the data and sanitize it if necessary.
|
||||
|
|
|
@ -88,7 +88,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
|
||||
// Dropzone also accept file extensions and doesn't correctly extract certain mimetypes (eg. FLAC - try it),
|
||||
// so we append the file extensions to the list of mimetypes and that makes it work.
|
||||
$mimeTypes = FileDataHelper::getAudioMimeTypeArray();
|
||||
$mimeTypes = FileDataHelper::getUploadAudioMimeTypeArray();
|
||||
$fileExtensions = array_values($mimeTypes);
|
||||
foreach ($fileExtensions as &$extension) {
|
||||
$extension = '.' . $extension;
|
||||
|
|
|
@ -139,7 +139,7 @@ class CcFiles extends BaseCcFiles
|
|||
// Only accept files with a file extension that we support.
|
||||
// Let the analyzer do the heavy lifting in terms of mime verification and playability
|
||||
$fileExtension = pathinfo($originalFilename, PATHINFO_EXTENSION);
|
||||
if (!in_array(strtolower($fileExtension), array_values(FileDataHelper::getAudioMimeTypeArray()))) {
|
||||
if (!in_array(strtolower($fileExtension), array_values(FileDataHelper::getUploadAudioMimeTypeArray()))) {
|
||||
throw new Exception('Bad file extension.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue