diff --git a/boards/forms/__init__.py b/boards/forms/__init__.py --- a/boards/forms/__init__.py +++ b/boards/forms/__init__.py @@ -298,11 +298,11 @@ class PostForm(NeboardForm): max_file_count = board_settings.get_int(SECTION_FORMS, 'MaxFileCount') if len(inputs) > max_file_count: raise forms.ValidationError(ERROR_MANY_FILES) - for input in inputs: - if isinstance(input, UploadedFile): - files.append(self._clean_file_file(input)) + for file_input in inputs: + if isinstance(file_input, UploadedFile): + files.append(self._clean_file_file(file_input)) else: - files.append(self._clean_file_url(input)) + files.append(self._clean_file_url(file_input)) return files diff --git a/boards/forms/fields.py b/boards/forms/fields.py --- a/boards/forms/fields.py +++ b/boards/forms/fields.py @@ -82,9 +82,9 @@ class UrlFileField(forms.MultiValueField for data in data_list: if type(data) == list: all_data += data - elif type(data) == str: - input = data.replace('\r\n', '\n') - url_list = input.split('\n') + elif type(data) == str and len(data) > 0: + file_input = data.replace('\r\n', '\n') + url_list = file_input.split('\n') all_data += url_list return all_data