From ae7d4734cb91667dfd9ebe1c0e878863a156adca Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Tue, 1 May 2018 16:01:40 +0100 Subject: [PATCH] FIX: PHP 5.4 compatibility --- code/FileAttachmentField.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/FileAttachmentField.php b/code/FileAttachmentField.php index 7bc2b2f..529446f 100644 --- a/code/FileAttachmentField.php +++ b/code/FileAttachmentField.php @@ -801,7 +801,8 @@ public function upload(SS_HTTPRequest $request) { } // No files detected in the upload, this can occur if post_max_size is < the upload size - if(empty($files) || empty($request->postVar($name))) { + $value = $request->postVar($name); + if(empty($files) || empty($value)) { $error_message = _t('FileAttachmentField.NOFILESUPLOADED', 'No files were detected in your upload. Please try again later.'); return $this->httpError(400, $error_message); }