Commit b4340aa9 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Stop unknown file types being detected as audio files (bug #829136)"

parents 7ac1eb33 78605215
...@@ -2287,7 +2287,6 @@ class ArtefactTypeVideo extends ArtefactTypeFile { ...@@ -2287,7 +2287,6 @@ class ArtefactTypeVideo extends ArtefactTypeFile {
class ArtefactTypeAudio extends ArtefactTypeFile { class ArtefactTypeAudio extends ArtefactTypeFile {
public static function new_audio($data) { public static function new_audio($data) {
$descriptions = self::audio_file_descriptions();
$validtypes = self::audio_mime_types(); $validtypes = self::audio_mime_types();
if (isset($validtypes[$data->filetype])) { if (isset($validtypes[$data->filetype])) {
return new ArtefactTypeAudio(0, $data); return new ArtefactTypeAudio(0, $data);
...@@ -2316,7 +2315,7 @@ class ArtefactTypeAudio extends ArtefactTypeFile { ...@@ -2316,7 +2315,7 @@ class ArtefactTypeAudio extends ArtefactTypeFile {
static $mimetypes = null; static $mimetypes = null;
if (is_null($mimetypes)) { if (is_null($mimetypes)) {
$descriptions = self::audio_file_descriptions(); $descriptions = self::audio_file_descriptions();
$mimetypes = PluginArtefactFile::get_mimetypes_from_description(array_keys($descriptions), true); $mimetypes = PluginArtefactFile::get_mimetypes_from_description($descriptions, true);
} }
return $mimetypes; return $mimetypes;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment