Last modified: 2014-06-12 18:05:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67547, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65547 - VisualEditor: Non-'bitcoin:' external links with single brackets around it should be indicated as invalid external link inside link inspector
VisualEditor: Non-'bitcoin:' external links with single brackets around it sh...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Data Model (Other open bugs)
unspecified
All All
: High normal
: VE-deploy-2014-06-19
Assigned To: Alex Monk
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-20 19:28 UTC by Rummana Yasmeen
Modified: 2014-06-12 18:05 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Screenshot (25.63 KB, image/png)
2014-05-20 19:28 UTC, Rummana Yasmeen
Details

Description Rummana Yasmeen 2014-05-20 19:28:08 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.
Comment 1 Chris McMahon 2014-05-20 19:52:55 UTC
note that the wikitext for the saved string reads: 

&#x5Dhttp://yahoo.com]
Comment 2 James Forrester 2014-06-12 05:04:03 UTC
Is our regex not anchored to the start of the string somehow?
Comment 3 Alex Monk 2014-06-12 16:06:31 UTC
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.
Comment 4 Gerrit Notification Bot 2014-06-12 16:06:56 UTC
Change 139128 had a related patch set uploaded by Alex Monk:
Wrap external URL protocols regex in brackets.

https://gerrit.wikimedia.org/r/139128
Comment 5 James Forrester 2014-06-12 16:21:20 UTC
Do we need to upstream a fix for wgUrlProtocols?
Comment 6 Alex Monk 2014-06-12 16:28:50 UTC
I don't think so. I think things including the wgUrlProtocols regex should be dealing with this issue themselves.
Comment 7 Gerrit Notification Bot 2014-06-12 17:05:17 UTC
Change 139128 merged by jenkins-bot:
Wrap external URL protocols regex in brackets.

https://gerrit.wikimedia.org/r/139128

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links