From d47e777adde0c0a58fb9e5d9c76eb27531f131b2 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Mon, 15 Sep 2014 10:42:11 -0300 Subject: [PATCH] removed unused variable, added default --- includes/datastream.inc | 1 - includes/mimetype.utils.inc | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/datastream.inc b/includes/datastream.inc index 592870b7..edc0026b 100644 --- a/includes/datastream.inc +++ b/includes/datastream.inc @@ -52,7 +52,6 @@ function islandora_view_datastream(AbstractDatastream $datastream, $download = F } if ($download) { // Browsers will not append all extensions. - $mime_detect = new MimeDetect(); $extension = '.' . islandora_get_extension_for_mimetype($datastream->mimetype); // Prevent adding on a duplicate extension. $label = $datastream->label; diff --git a/includes/mimetype.utils.inc b/includes/mimetype.utils.inc index 3aef6994..1a20859d 100644 --- a/includes/mimetype.utils.inc +++ b/includes/mimetype.utils.inc @@ -12,13 +12,13 @@ * The mimetype whose extension is required. * * @return string - * The extension mapped to the given mimetype. + * The extension mapped to the given mimetype. Defaults to 'bin'. */ function islandora_get_extension_for_mimetype($mimetype) { // file.mimetypes.inc is a part of Drupal core, however is not // automatically loaded. Manually require it. require_once DRUPAL_ROOT . "/includes/file.mimetypes.inc"; - + $extension = 'bin'; $mimetype_mapping = file_mimetype_mapping(); $extension_index = array_search($mimetype, $mimetype_mapping['mimetypes']); if ($extension_index !== FALSE) {