#32345: i18n.set_language unquotes next_url and produces wrong url for url 
params
containing "&" character
-------------------------------------+-------------------------------------
               Reporter:  Sebastian  |          Owner:  nobody
  Kapunkt                            |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  3.1
  Internationalization               |
               Severity:  Normal     |       Keywords:  i18n unquote
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When changing the language and the current URL parameter include a
 parameter value with an encoded  "&" like

 {{{
 ?paramter=some%20%26%20thing
 }}}

 the redirect response from ```set_langauge``` is

 {{{
 ?paramter=some%20&%20thing
 }}}
 where I would still expect the same URL from as in the beginning.

 I've written a Django test that shows this bug:
 {{{
 def test_set_language_url_params():
     from django.test import RequestFactory
     from django.views.i18n import set_language

     rf = RequestFactory()
     request = rf.post("", next="")
     request.META['HTTP_REFERER'] = '/someurl/?paramter=some%20%26%20thing'

     response = set_language(request)
     assert response.url == '/someurl/?paramter=some%20%26%20thing'
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32345>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/059.04e2d092c0044c526c65a7065e12576b%40djangoproject.com.

Reply via email to