From eb06ec4490593e14d6a2d2f09e3b1cd2229800ab Mon Sep 17 00:00:00 2001 From: James Warp Date: Mon, 29 Jan 2018 15:54:01 -0500 Subject: [PATCH] Fix attachments code When downloading an attachment, the byte length of the file is appended, see issue #617. --- src/data/attachment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/attachment.php b/src/data/attachment.php index c7a3d5b7..514246eb 100644 --- a/src/data/attachment.php +++ b/src/data/attachment.php @@ -25,7 +25,7 @@ class AttachmentDataController extends DataController { // Remove all non alpahnum characters from filename - allow international chars, dash, underscore, and period $filename = preg_replace('/[^\p{L}\p{N}_\-.]+/u', '_', $filename); - $data = readfile(Attachment::attachmentsDir.$filename); + $data = file_get_contents(Attachment::attachmentsDir.$filename); } }