Last modified: 2014-02-21 20:09:10 UTC
Gallery handling of link parameter is a bit odd (presumably due to recursiveTagParsing and trimming things before splitting up by '|' instead of after). Example: <gallery> Foo.jpg|link=http://somewhere.com|caption </gallery> Expected behaviour: Link to http://somewhere.com Actual behaviour: Link to http://somewhere.com%2Ccaption <gallery> Foo.jpg|link=http://somewhere.com |caption </gallery> Expected behaviour: link to http://somewhere.com Actual behaviour: it treats it as an internal link - http://mywiki.com/w/index.php/http://somewhere.com ----- I suppose if we changed this we would have to be careful over breaking back-compat(?). In particular the whole recursiveTagParse thing probably means someone is using {{!}} to split up components.
I'm going to add to this bug other oddities with the link= parameter in galleries (I'm not sure if it should be split, but seemed related): * External links with ampersands get the ampersands double-HTML-escaped: the link has the & converted to & when you open it, the HTML source is "&amp;" File:Foo.jpg|link=http://example.com/?param1=1¶m2=2 Is rendered with a link to http://example.com/?param1=1&param2=2 * Internal links with an anchor: The anchor is stripped from the link: File:Foo.jpg|link=Article#Anchor Is rendered with a link to Article Test case: https://www.mediawiki.org/w/index.php?oldid=849650
Bumping importance & priority to normal, since for issues in comment 1 there are no workarounds (workaround for comment 0 is to leave the link= parameter at the end). Maybe it would make sense to split it, but I'm not sure if it's something specific to galleries or more general as Bawolff suggests
Also, it would make sense to expect that "link=" removes the link from the image just as it does in regular image links. However, the link persists. I can file a separate bug about this, if that helps.