Django

Code

Changeset 9189

Show
Ignore:
Timestamp:
10/07/08 05:39:16 (3 months ago)
Author:
mtredinnick
Message:

Fixed #9224 -- Prevent a crash when certain query strings are sent using
modpython.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/handlers/modpython.py

    r9064 r9189  
    77from django.core.urlresolvers import set_script_prefix 
    88from django.utils import datastructures 
    9 from django.utils.encoding import force_unicode, smart_str 
     9from django.utils.encoding import force_unicode, smart_str, iri_to_uri 
    1010 
    1111# NOTE: do *not* import settings (or any module which eventually imports 
     
    6565 
    6666    def get_full_path(self): 
    67         return '%s%s' % (self.path, self._req.args and ('?' + self._req.args) or '') 
     67        # RFC 3986 requires self._req.args to be in the ASCII range, but this 
     68        # doesn't always happen, so rather than crash, we defensively encode it. 
     69        return '%s%s' % (self.path, self._req.args and ('?' + iri_to_uri(self._req.args)) or '') 
    6870 
    6971    def is_secure(self):