Skip to content

Commit

Permalink
[FIX] small issue with non existing suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chfsx committed Dec 3, 2024
1 parent 5c14cbe commit 5edb41e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/Event/class.xoctEventGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ function ($publication) use ($usage_type, $usage_id): bool {
}

$url = $publication->getUrl();
$extension = pathinfo($url)['extension'];
$extension = pathinfo($url)['extension'] ?? '';
$url = PluginConfig::getConfig(PluginConfig::F_SIGN_DOWNLOAD_LINKS) ? xoctSecureLink::signDownload($url) : $url;

// if (PluginConfig::getConfig(PluginConfig::F_EXT_DL_SOURCE)) {
Expand All @@ -966,7 +966,8 @@ function ($publication) use ($usage_type, $usage_id): bool {
// deliver file
header('Content-Description: File Transfer');
header('Content-Type: ' . $publication->getMediatype());
header('Content-Disposition: attachment; filename="' . $event->getTitle() . '.' . $extension . '"');
$filename = $event->getTitle() . (empty($extension) ? '' : '.' . $extension);
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Length: ' . $size);
readfile($url);
}
Expand Down

0 comments on commit 5edb41e

Please sign in to comment.