|
|
@ -1564,9 +1564,12 @@ function islandora_entity_property_info() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_download_clip(AbstractObject $object) { |
|
|
|
function islandora_download_clip(AbstractObject $object) { |
|
|
|
if (isset($_GET['clip'])) { |
|
|
|
if (isset($_GET['clip'])) { |
|
|
|
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'; |
|
|
|
$url = $_GET['clip']; |
|
|
|
$http_protocol = $is_https ? 'https' : 'http'; |
|
|
|
if (!preg_match('/^https?:\/\//', $url)) { |
|
|
|
$url = $http_protocol . '://' . $_SERVER['HTTP_HOST'] . $_GET['clip']; |
|
|
|
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'; |
|
|
|
|
|
|
|
$http_protocol = $is_https ? 'https' : 'http'; |
|
|
|
|
|
|
|
$url = $http_protocol . '://' . $_SERVER['HTTP_HOST'] . $url; |
|
|
|
|
|
|
|
} |
|
|
|
$filename = $object->label; |
|
|
|
$filename = $object->label; |
|
|
|
header("Content-Disposition: attachment; filename=\"{$filename}.jpg\""); |
|
|
|
header("Content-Disposition: attachment; filename=\"{$filename}.jpg\""); |
|
|
|
header("Content-type: image/jpeg"); |
|
|
|
header("Content-type: image/jpeg"); |
|
|
|