Changes between Initial Version and Version 1 of Ticket #26308, comment 9


Ignore:
Timestamp:
Mar 4, 2016, 1:15:28 AM (9 years ago)
Author:
Mariusz Felisiak

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26308, comment 9

    initial v1  
    1616     LANGUAGE_SESSION_KEY, check_for_language, get_language, to_locale,
    1717 )
    18 @@ -35,6 +36,8 @@ def set_language(request):
     18@@ -34,7 +35,7 @@ def set_language(request):
     19     """
    1920     next = request.POST.get('next', request.GET.get('next'))
    2021     if not is_safe_url(url=next, host=request.get_host()):
    21          next = request.META.get('HTTP_REFERER')
    22 +        if next is not None:
    23 +            next = force_text(next)
     22-        next = request.META.get('HTTP_REFERER')
     23+        next = force_text(request.META.get('HTTP_REFERER'), strings_only=True, errors='replace')
    2424         if not is_safe_url(url=next, host=request.get_host()):
    2525             next = '/'
    2626     response = http.HttpResponseRedirect(next)
     27
    2728}}}
Back to Top