Last modified: 2014-06-12 18:05:13 UTC
Created attachment 15447 [details] Screenshot Steps to reproduce: 1.Open a page with VE 2.Open the link inspector : insert [http://yahoo.com] 3.Apply the link 4.Save the page Observed Result: The link appears inside VE with single brackets around it: [http://yahoo.com] And when you save the page, the unicode for the ending single bracket appears at the end of the link as a part of that link:[http://yahoo.com] Expected Result: The link inspector should say to user that it is an invalid external link format.
note that the wikitext for the saved string reads: ]http://yahoo.com]
Is our regex not anchored to the start of the string somehow?
Currently, the regex looks something like this (based on wgUrlProtocols): /^bitcoin\:|ftp\:\/\/|ftps\:\/\/|geo\:|git\:\/\/|gopher\:\/\/|http\:\/\/|https\:\/\/|irc\:\/\/|ircs\:\/\/|magnet\:|mailto\:|mms\:\/\/|news\:|nntp\:\/\/|redis\:\/\/|sftp\:\/\/|sip\:|sips\:|sms\:|ssh\:\/\/|svn\:\/\/|tel\:|telnet\:\/\/|urn\:|worldwind\:\/\/|xmpp\:|\/\// Notice the '^' is only against 'bitcoin' and not any other protocol? Yeah I think we need to wrap everything after the '^' in brackets.
Change 139128 had a related patch set uploaded by Alex Monk: Wrap external URL protocols regex in brackets. https://gerrit.wikimedia.org/r/139128
Do we need to upstream a fix for wgUrlProtocols?
I don't think so. I think things including the wgUrlProtocols regex should be dealing with this issue themselves.
Change 139128 merged by jenkins-bot: Wrap external URL protocols regex in brackets. https://gerrit.wikimedia.org/r/139128