Changes between Initial Version and Version 1 of Ticket #26308, comment 9
- Timestamp:
- Mar 4, 2016, 1:15:28 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26308, comment 9
initial v1 16 16 LANGUAGE_SESSION_KEY, check_for_language, get_language, to_locale, 17 17 ) 18 @@ -35,6 +36,8 @@ def set_language(request): 18 @@ -34,7 +35,7 @@ def set_language(request): 19 """ 19 20 next = request.POST.get('next', request.GET.get('next')) 20 21 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') 24 24 if not is_safe_url(url=next, host=request.get_host()): 25 25 next = '/' 26 26 response = http.HttpResponseRedirect(next) 27 27 28 }}}