#30043: AdminURLFieldWidget incorrectly unquotes URLs e.g. containing %2F
-------------------------------------+-------------------------------------
     Reporter:  Brenton Partridge    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  admin, urlfield,     |             Triage Stage:  Accepted
  smart_urlquote, url, quote         |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * cc: Florian Apolloner (added)


Comment:

 The `smart_urlquote()` dates to the original implementation in #17549
 merged by Florian. I don't have much expertise to say whether or not it's
 useful.

 I explored the first
 
[https://github.com/django/django/blob/19e863a844db137045499276f0b0494b180f3f1a/tests/admin_widgets/tests.py#L369
 test URL] `http://example.com/<sometag>some text</sometag>` and found that
 clicking that URL stills works after removing `smart_urlquote()` as long
 as the space in the test URL is encoded (bit test URL changed from `some
 text` to `some%20text`. That seems fine because `URLValidator` won't
 accept URLs that unencoded spaces in them.

 Tread carefully since there was also a security issue in this code,
 cbe6d5568f4f5053ed7228ca3c3d0cce77cf9560.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30043#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.50adac0db8528f5cfac8247a9f610e10%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to