Ticket #15879: multipart_file_with_emptry_string_name.2.patch
File multipart_file_with_emptry_string_name.2.patch, 1.1 KB (added by , 14 years ago) |
---|
-
django/http/multipartparser.py
162 162 force_unicode(data, encoding, errors='replace')) 163 163 elif item_type == FILE: 164 164 # This is a file, use the handler... 165 if not 'filename' in disposition: 166 continue 165 167 file_name = disposition.get('filename') 166 if not file_name:167 continue168 if file_name == '': 169 file_name = None 168 170 file_name = force_unicode(file_name, encoding, errors='replace') 169 171 file_name = self.IE_sanitize(unescape_entities(file_name)) 170 172 … … 586 588 587 589 if name == 'content-disposition': 588 590 TYPE = FIELD 589 if params.get('filename'):591 if 'filename' in params: 590 592 TYPE = FILE 591 593 592 594 outdict[name] = value, params