Author: jacob
Date: 2007-09-28 17:34:27 -0500 (Fri, 28 Sep 2007)
New Revision: 6435

Modified:
   django/trunk/AUTHORS
   django/trunk/django/utils/cache.py
Log:
Fixed #5557: URLs are now properly escaped in the cache_page decorator. Thanks, 
eriks.

Modified: django/trunk/AUTHORS
===================================================================
--- django/trunk/AUTHORS        2007-09-28 22:30:59 UTC (rev 6434)
+++ django/trunk/AUTHORS        2007-09-28 22:34:27 UTC (rev 6435)
@@ -114,6 +114,7 @@
     Enrico <[EMAIL PROTECTED]>
     A. Murat Eren <[EMAIL PROTECTED]>
     Ludvig Ericson <[EMAIL PROTECTED]>
+    [EMAIL PROTECTED]
     Dirk Eschler <[EMAIL PROTECTED]>
     Marc Fargas <[EMAIL PROTECTED]>
     Szilveszter Farkas <[EMAIL PROTECTED]>

Modified: django/trunk/django/utils/cache.py
===================================================================
--- django/trunk/django/utils/cache.py  2007-09-28 22:30:59 UTC (rev 6434)
+++ django/trunk/django/utils/cache.py  2007-09-28 22:34:27 UTC (rev 6435)
@@ -23,7 +23,7 @@
 from email.Utils import formatdate
 from django.conf import settings
 from django.core.cache import cache
-from django.utils.encoding import smart_str
+from django.utils.encoding import smart_str, iri_to_uri
 
 cc_delim_re = re.compile(r'\s*,\s*')
 
@@ -125,7 +125,7 @@
         value = request.META.get(header, None)
         if value is not None:
             ctx.update(value)
-    return 'views.decorators.cache.cache_page.%s.%s.%s' % (key_prefix, 
request.path, ctx.hexdigest())
+    return 'views.decorators.cache.cache_page.%s.%s.%s' % (key_prefix, 
iri_to_uri(request.path), ctx.hexdigest())
 
 def get_cache_key(request, key_prefix=None):
     """
@@ -139,7 +139,7 @@
     """
     if key_prefix is None:
         key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
-    cache_key = 'views.decorators.cache.cache_header.%s.%s' % (key_prefix, 
request.path)
+    cache_key = 'views.decorators.cache.cache_header.%s.%s' % (key_prefix, 
iri_to_uri(request.path))
     headerlist = cache.get(cache_key, None)
     if headerlist is not None:
         return _generate_cache_key(request, headerlist, key_prefix)
@@ -163,7 +163,7 @@
         key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
     if cache_timeout is None:
         cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS
-    cache_key = 'views.decorators.cache.cache_header.%s.%s' % (key_prefix, 
request.path)
+    cache_key = 'views.decorators.cache.cache_header.%s.%s' % (key_prefix, 
iri_to_uri(request.path))
     if response.has_header('Vary'):
         headerlist = ['HTTP_'+header.upper().replace('-', '_') for header in 
vary_delim_re.split(response['Vary'])]
         cache.set(cache_key, headerlist, cache_timeout)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to