Skip to content

Commit

Permalink
[xs][bugfix] url encodings now fixed in I18nMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Mar 5, 2012
1 parent 5723d49 commit d723c4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ckan/config/middleware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pylons middleware initialization"""
import urllib
import logging

from beaker.middleware import CacheMiddleware, SessionMiddleware
Expand Down Expand Up @@ -177,7 +178,13 @@ def __call__(self, environ, start_response):

# Current application url
path_info = environ['PATH_INFO']
# sort out weird encodings
path_info = '/'.join(urllib.quote(pce,'') for pce in path_info.split('/'))

qs = environ.get('QUERY_STRING')
# sort out weird encodings
qs = urllib.quote(qs, '')

if qs:
environ['CKAN_CURRENT_URL'] = '%s?%s' % (path_info, qs)
else:
Expand Down

0 comments on commit d723c4d

Please sign in to comment.