#36923: URLField mangles mailto: URLs
-------------------------------------+-------------------------------------
     Reporter:  waveywhite           |                    Owner:  Natalia
                                     |  Bidart
         Type:  Bug                  |                   Status:  assigned
    Component:  Forms                |                  Version:  5.2
     Severity:  Normal               |               Resolution:
     Keywords:  mailto urlfield      |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Vishy Algo):

 Replying to [comment:5 Jacob Walls]:
 > Hi Vishy. Natalia mentioned she has a local stash that solves this
 issue. Do you mind if I assign it to her? I don't want you to duplicate
 any effort.

 That's fine Jacob. However, I wanna give a heads up on this:

 While verifying scheme in {{{ django.core.validators.URLValidator }}}, the
 delimiter used in {{{ :// }}}. I think we should just use a semi-colon
 (":"), which is standard scheme delimiter according to [https://www.rfc-
 editor.org/rfc/rfc3986.html#section-1.2.3 RFC 3986 Standards].

 Please have a look at this, and provide your opinion.

 {{{
 #!diff
  --git a/django/core/validators.py b/django/core/validators.py
 index 534acdd904..18239e3ad4 100644
 --- a/django/core/validators.py
 +++ b/django/core/validators.py
 @@ -166,7 +166,7 @@ class URLValidator(RegexValidator):
           if self.unsafe_chars.intersection(value):
               raise ValidationError(self.message, code=self.code,
 params={"value": value})
           # Check if the scheme is valid.
 -        scheme = value.split("://")[0].lower()
 +        scheme = value.split(":")[0].lower()
           if scheme not in self.schemes:
               raise ValidationError(self.message, code=self.code,
 params={"value": value})
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36923#comment:6>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019c799f6d41-ca16d6ee-5d53-4561-8f15-d76a5ffcf2a9-000000%40eu-central-1.amazonses.com.

Reply via email to