Browse Source

removed unused variable, added default

pull/547/head
Alan Stanley 10 years ago
parent
commit
d47e777add
  1. 1
      includes/datastream.inc
  2. 4
      includes/mimetype.utils.inc

1
includes/datastream.inc

@ -52,7 +52,6 @@ function islandora_view_datastream(AbstractDatastream $datastream, $download = F
} }
if ($download) { if ($download) {
// Browsers will not append all extensions. // Browsers will not append all extensions.
$mime_detect = new MimeDetect();
$extension = '.' . islandora_get_extension_for_mimetype($datastream->mimetype); $extension = '.' . islandora_get_extension_for_mimetype($datastream->mimetype);
// Prevent adding on a duplicate extension. // Prevent adding on a duplicate extension.
$label = $datastream->label; $label = $datastream->label;

4
includes/mimetype.utils.inc

@ -12,13 +12,13 @@
* The mimetype whose extension is required. * The mimetype whose extension is required.
* *
* @return string * @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) { function islandora_get_extension_for_mimetype($mimetype) {
// file.mimetypes.inc is a part of Drupal core, however is not // file.mimetypes.inc is a part of Drupal core, however is not
// automatically loaded. Manually require it. // automatically loaded. Manually require it.
require_once DRUPAL_ROOT . "/includes/file.mimetypes.inc"; require_once DRUPAL_ROOT . "/includes/file.mimetypes.inc";
$extension = 'bin';
$mimetype_mapping = file_mimetype_mapping(); $mimetype_mapping = file_mimetype_mapping();
$extension_index = array_search($mimetype, $mimetype_mapping['mimetypes']); $extension_index = array_search($mimetype, $mimetype_mapping['mimetypes']);
if ($extension_index !== FALSE) { if ($extension_index !== FALSE) {

Loading…
Cancel
Save