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.
This commit is contained in:
Guillermo Alvarez 2018-08-24 12:40:06 -05:00
parent 6e2e63457e
commit e0dac0f4d7

View File

@ -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']);