#25635 closed Bug (fixed)
Fix URLValidator to allow the '+' character in URL scheme
Reported by: | Dheerendra Rathor | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.8 |
Severity: | Normal | Keywords: | urlvalidator, regexvalidator |
Cc: | zborboa@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Quoting w3's url-spec
A complete URL consists of a naming scheme specifier followed by a string whose format is a function of the naming scheme.
and
Within the URL of a object, the first element is the name of the scheme, separated from the rest of the object by a colon. The rest of the URL follows the colon in a format depending on the scheme.
So basically scheme should be present in URL syntax. Current scheme regex is ^(?:[a-z0-9\.\-]*)://
which allows empty schemes.
Also schemes should allow alphanumeric characters with -
, .
and +
(rfc1738).
Change History (6)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
The very common example is git with ssh i.e. using git+ssh
in scheme name. Hg-Git plugin uses this scheme http://hg-git.github.io/. Yeah they are somewhat rarely used. I guess Phabricator default ssh clone URL is also git+ssh.
comment:3 by , 9 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 9 years ago
Patch needs improvement: | unset |
---|---|
Summary: | URLValidator regex is not allowing '+' character in scheme and also scheme part is optional → Fix URLValidator to allow the '+' character in URL scheme |
Triage Stage: | Accepted → Ready for checkin |
comment:6 by , 9 years ago
Cc: | added |
---|
When does a plus sign appear in the scheme in practice? I think schema validation is handled outside of the regular expression. Could you give an example of unexpected behavior with actual inputs?