|
|
@ -56,9 +56,12 @@ function islandora_view_datastream(AbstractDatastream $datastream, $download = F |
|
|
|
$extension = '.' . $mime_detect->getExtension($datastream->mimetype); |
|
|
|
$extension = '.' . $mime_detect->getExtension($datastream->mimetype); |
|
|
|
|
|
|
|
|
|
|
|
// Prevent adding on a duplicate extension. |
|
|
|
// Prevent adding on a duplicate extension. |
|
|
|
|
|
|
|
$label = $datastream->label; |
|
|
|
$extension_length = strlen($extension); |
|
|
|
$extension_length = strlen($extension); |
|
|
|
$duplicate_extension_position = strripos($datastream->label, $extension, -$extension_length); |
|
|
|
$duplicate_extension_position = strlen($label) > $extension_length ? |
|
|
|
$filename = $datastream->label; |
|
|
|
strripos($label, $extension, -$extension_length) : |
|
|
|
|
|
|
|
FALSE; |
|
|
|
|
|
|
|
$filename = $label; |
|
|
|
if ($duplicate_extension_position === FALSE) { |
|
|
|
if ($duplicate_extension_position === FALSE) { |
|
|
|
$filename .= $extension; |
|
|
|
$filename .= $extension; |
|
|
|
} |
|
|
|
} |
|
|
|