Skip to content
Snippets Groups Projects
Commit a382bc24 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix crash navigating from user directory

parent d1076d7c
No related branches found
No related tags found
No related merge requests found
......@@ -29,11 +29,16 @@ if (!$_GET['key']
// Validate session access hash - we want to make sure the link is FRESH!
// and the user has access to the parent ticket!!
if ($file->verifySignature($_GET['signature'], $_GET['expires'])) {
if (($s = @$_GET['s']) && strpos($file->getType(), 'image/') === 0)
return $file->display($s);
try {
if (($s = @$_GET['s']) && strpos($file->getType(), 'image/') === 0)
return $file->display($s);
// Download the file..
$file->download(@$_GET['disposition'] ?: false, $_GET['expires']);
// Download the file..
$file->download(@$_GET['disposition'] ?: false, $_GET['expires']);
}
catch (Exception $x) {
Http::response(500, 'Unable to find that file: '.$ex->getMessage());
}
}
// else
Http::response(404, __('Unknown or invalid file'));
......@@ -1010,5 +1010,5 @@ foreach (AttachmentFile::objects()->filter(array(
'filename' => $file->name,
);
} ?>
$.showImagesInline(<?php echo JsonDataEncoder::encode($urls); ?>);
$('#ticket_thread').data('imageUrls', <?php echo JsonDataEncoder::encode($urls); ?>);
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment