Ticket #5611: parsesql.diff
File parsesql.diff, 1.4 KB (added by , 16 years ago) |
---|
-
django/http/__init__.py
9 9 from mod_python.util import parse_qsl 10 10 except ImportError: 11 11 from cgi import parse_qsl 12 # whilst being efficient, the mod_python version also breaks on certain data, so we need this for those cases 13 from cgi import parse_qsl as parse_qsl_cgi 12 14 13 15 from django.utils.datastructures import MultiValueDict, ImmutableList 14 16 from django.utils.encoding import smart_str, iri_to_uri, force_unicode … … 144 146 from django.conf import settings 145 147 encoding = settings.DEFAULT_CHARSET 146 148 self.encoding = encoding 147 for key, value in parse_qsl((query_string or ''), True): # keep_blank_values=True 148 self.appendlist(force_unicode(key, encoding, errors='replace'), 149 force_unicode(value, encoding, errors='replace')) 149 def do_parse(parse_qsl_method): 150 for key, value in parse_qsl_method((query_string or ''), True): # keep_blank_values=True 151 self.appendlist(force_unicode(key, encoding, errors='replace'), 152 force_unicode(value, encoding, errors='replace')) 153 try: 154 do_parse(parse_qsl) 155 except TypeError: 156 do_parse(parse_qsl_cgi) 150 157 self._mutable = mutable 151 158 152 159 def _get_encoding(self):