From 64fc0d6c4dca41be81dc59a6c1f338ea0a5e9023 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Fri, 4 Oct 2013 19:01:39 +0200 Subject: [PATCH] Fixed issue #8118: Participant can upload file without size limit with question type fileupload. Dev: quick fix Dev: max file is done by EM in survey page Dev: Add preview in take from PHP --- application/controllers/UploaderController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/controllers/UploaderController.php b/application/controllers/UploaderController.php index 61e41211e01..21655df8520 100644 --- a/application/controllers/UploaderController.php +++ b/application/controllers/UploaderController.php @@ -105,14 +105,13 @@ function run($actionID) } $filename = $_FILES['uploadfile']['name']; $size = 0.001 * $_FILES['uploadfile']['size']; - $valid_extensions = strtolower($_POST['valid_extensions']); - $maxfilesize = (int) $_POST['max_filesize']; - $preview = $_POST['preview']; + $preview = Yii::app()->session['preview']; $fieldname = $_POST['fieldname']; $aFieldMap = createFieldMap($surveyid,'short',false,false,$_SESSION['survey_'.$surveyid]['s_lang']); if (!isset($aFieldMap[$fieldname])) die(); $aAttributes=getQuestionAttributeValues($aFieldMap[$fieldname]['qid'],$aFieldMap[$fieldname]['type']); + $maxfilesize = (int) $aAttributes['max_filesize']; $valid_extensions_array = explode(",", $aAttributes['allowed_filetypes']); $valid_extensions_array = array_map('trim',$valid_extensions_array);