Last modified: 2014-04-07 23:03:59 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 T58196, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56196 - Flow: Remove square brackets ("[" and "]") from Flow-related URLs
Flow: Remove square brackets ("[" and "]") from Flow-related URLs
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Flow (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-26 00:45 UTC by Quiddity
Modified: 2014-04-07 23:03 UTC (History)
8 users (show)

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


Attachments

Description Quiddity 2013-10-26 00:45:12 UTC
Don't use square brackets in urls - many email programs and IRC programs will break the link, and wikis will incorrectly interpret it.  (Also avoid round brackets, and quotation marks, if possible)

eg. http://ee-flow.wmflabs.org/w/index.php?title=Talk:Flow_workshop&topic[postId]=0506fd0ed2010e132562fa163e68c4ac&workflow=0506fc4aad826e5b09a3fa163e68c4ac&action=edit-post
Comment 1 spage 2013-10-28 10:48:57 UTC
The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/363, but people from the community are welcome to contribute here and in Gerrit.
Comment 2 Andrew Garrett 2013-10-29 00:19:50 UTC
Unable to reproduce.

I looked at a few URLs displayed in the interface, and they're all escaped correctly.

Where did you get this link?
Comment 4 Andrew Garrett 2013-10-29 00:26:54 UTC
S, care to elaborate?
Comment 5 spage 2013-10-29 06:24:52 UTC
Andrew and S can't reproduce, so closed in Mingle, and here.

ErikB says square brackets are the way that MediaWiki can pass array arguments in URLs, that's a good reason to use them.
Comment 6 Oliver Keyes 2013-10-29 16:17:38 UTC
Reopening; S, you reproduced an example of this kind of URL in bug #56300 ;p
Comment 8 Erik Bernhardson 2013-10-29 20:38:29 UTC
And for reference, the 'fixed' version of quidditys example url is:

http://ee-flow.wmflabs.org/w/index.php?title=Special:Flow/Sandbox&topic_list%5Boffset-id%5D=050805974f590e132562fa163e68c4ac&topic_list%5Boffset-dir%5D=fwd&topic_list%5Blimit%5D=5&workflow=0503c3d2e3d2ad56ca39fa163e68c4ac&action=view

This is basically urlencode( 'topic_list[offset-dir]' ) which returns 'topic_list%5Boffset-dir%5D'
Comment 10 Quiddity 2013-12-31 01:53:48 UTC
Also in diffs, eg https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&topic[newRevision]=050c87914c196f3747a890b11c28d448&topic[oldRevision]=050c878e4ad055356901842b2b77d2bd&workflow=050c553390ab9384b03a842b2b77e406&action=compare-revisions

(I'm not sure if these additional examples help, or if they'll all be automagically fixed via a single change somewhere? Let me know :)
Comment 11 Quiddity 2014-01-11 03:12:27 UTC
Another fresh example. This is causing problems.
https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&workflow=050defb4e07513ccf17190b11c2d680e#flow-post-050df155089fcfb51c0e782bcb016050

(Also, the mingle card needs to be re-opened, but I cannot change the "Accepted" status: https://wikimedia.mingle.thoughtworks.com/projects/flow/cards/363
Comment 12 spage 2014-01-13 11:04:30 UTC
(In reply to comment #9)
> Another group of unescaped brackets, found in all "comment" links in history
> pages, eg.
> 
> http://ee-flow.wmflabs.org/w/index.php?title=User_talk:
> Quiddity&workflow=0506915cf3d0b62ef835fa163e68c4ac&action=topic-history

If I View > Source of that page, or select "added a comment" and View > Selection Source, I see %5B and %5D in the HTML, not square brackets.

(In reply to comment #10)
> Also in diffs, eg
Again, if you View > Source the URLs of the "history page" and "20 days ago" links contain %5B and %5D, not brackets.

Note that when you mouse over these, and when you copy and paste them, your browser shows you '[' and ']' in place of the %5B and %5D -- try it with the URL in comment #8 -- so it's hard to tell what's going on. View > Source.

(In reply to comment #11)
That seems like a bug.  The hyperlink ends at the square brackets.  I don't know if Flow should be escaping URLs before submitting to Parsoid or if Parsoid is doing something wrong.
Comment 13 MZMcBride 2014-01-31 02:26:01 UTC
Another example: https://www.mediawiki.org/w/index.php?title=Talk:Flow&topic[postId]=050f90d90ce1662828ca90b11c28d444&workflow=050f6a5c16971e9b25a890b11c27a364

Please do not use [ and ] in the URL. This breaks wikimarkup (try making an external link with the URL above in it) and is just generally ugly and bad. The use of [ and ] in URLs is definitely a valid bug.
Comment 14 MZMcBride 2014-01-31 03:45:33 UTC
Possibly related: https://gerrit.wikimedia.org/r/110501
Comment 15 Gerrit Notification Bot 2014-01-31 17:31:01 UTC
Change 110501 had a related patch set uploaded by EBernhardson:
Switch to underscores, because php mangles everything else

https://gerrit.wikimedia.org/r/110501
Comment 17 Gerrit Notification Bot 2014-02-06 00:15:53 UTC
Change 110501 merged by jenkins-bot:
Switch to underscores, because php mangles everything else

https://gerrit.wikimedia.org/r/110501
Comment 18 spage 2014-02-06 09:05:57 UTC
This fix on ee-flow is causing problems in mini-pencil > Show changes links, see bug 60947
Comment 19 spage 2014-03-14 22:01:07 UTC
Links with topic[postId] in their URL are still present in Special:RecentChanges, specifically its "full-date" and "|post)" links. E.g. 

http://ee-flow.wmflabs.org/w/index.php?title=User_talk:Maryana&workflow=rmk2kkoa3x4tnzsq&topic%5BpostId%5D=rmk2kkoa3x4tnzsq&action=post-history


The issue might lie in postLink() and postHistoryLink() in includes/Formatter/AbstractFormatter.php, which pass 
   'topic' => array( 'postId'
to UrlGenerator->buildUrl , maybe they should call generateBlockUrl() and a version that permits a particular action
Comment 20 Gerrit Notification Bot 2014-03-25 00:58:00 UTC
Change 120732 had a related patch set uploaded by Bsitu:
Remove [] from URL

https://gerrit.wikimedia.org/r/120732
Comment 21 Gerrit Notification Bot 2014-03-25 17:21:31 UTC
Change 120732 merged by jenkins-bot:
Remove [] from URL

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

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


Navigation
Links