From 9a5144104cc006bd9851942985f8df633c94478b Mon Sep 17 00:00:00 2001 From: Derek Kaijser Date: Thu, 2 Mar 2017 12:46:13 +1300 Subject: [PATCH] Fix empty file fields Fix for empty file fields when not all upload fields are used. --- code/model/UserDefinedForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php index 94ad55e..8ac201c 100755 --- a/code/model/UserDefinedForm.php +++ b/code/model/UserDefinedForm.php @@ -679,7 +679,7 @@ JS if (!empty($data[$field->Name])) { if (in_array("EditableFileField", $field->getClassAncestry())) { - if (isset($_FILES[$field->Name])) { + if (!empty($_FILES[$field->Name]['name'])) { $foldername = $field->getFormField()->getFolderName(); // create the file from post data