From e0dac0f4d7f6eb45b23c2eb4f21a584f4cb90b07 Mon Sep 17 00:00:00 2001 From: Guillermo Alvarez Date: Fri, 24 Aug 2018 12:40:06 -0500 Subject: [PATCH] MDL-63231 filepicker: Skype validation for null values In file_get_all_files_in_draftarea function an integer could get a null value so it is necessary to execute this function only when is called with a valid integer value. --- lib/form/filemanager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/form/filemanager.php b/lib/form/filemanager.php index 26c2271e0d4..af191a0e8d6 100644 --- a/lib/form/filemanager.php +++ b/lib/form/filemanager.php @@ -320,11 +320,15 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element implements temp /** * Check that all files have the allowed type. * - * @param array $value Draft item id with the uploaded files. + * @param int $value Draft item id with the uploaded files. * @return string|null Validation error message or null. */ public function validateSubmitValue($value) { + if (empty($value)) { + return; + } + $filetypesutil = new \core_form\filetypes_util(); $whitelist = $filetypesutil->normalize_file_types($this->_options['accepted_types']);