Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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 Tim Graham, 9 years ago

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?

comment:2 by Dheerendra Rathor, 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 Tim Graham, 9 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham, 9 years ago

Patch needs improvement: unset
Summary: URLValidator regex is not allowing '+' character in scheme and also scheme part is optionalFix URLValidator to allow the '+' character in URL scheme
Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 06627ef:

Fixed #25635 -- Made URLValidator allow '+' in scheme.

comment:6 by Zach Borboa, 9 years ago

Cc: zborboa@… added
Note: See TracTickets for help on using tickets.
Back to Top