https://bugzilla.wikimedia.org/show_bug.cgi?id=30712

       Web browser: ---
             Bug #: 30712
           Summary: mw.Uri throws error for protocol-relative urls
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Javascript
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
            Blocks: 28425
    Classification: Unclassified


Right now mw.Uri doesn't use wgUrlProtocols to build it's regex. This is both a
good and a bad thing.

The good thing is that it isn't limited in interpretation to urls that
MediaWiki accepts or finds 'safe'. The down side is that it is harder to detect
if a url has a protocol that the MediaWiki instance accepts and it doesn't
support protocol-relative urls.

I suggest one or more of the following:
* Change the loose/strict parse regex to accept procol-relative urls
* Add a static method: mw.Uri.expandUrl (which adds protocol (if not present)
and perhaps wgServer as well if needed)
* Add prototype function that returns true/false depending on whether the
protocol is in wgUrlProtocols

I think we should implement expandUrl no matter what. In addition we can either
require that input to the mw.Uri constructor be an expanded url (and if users
of it want to they can call expandUrl first), or we allow protocol to be empty
in case the regex needs to be changed.

Since 1.18 is about protocol-relative support, I think this should be handled
before release. Adding dependency to the milestone

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to