Page MenuHomePhabricator

"link=" parameter in [[Image: ignores $wgExternalLinkTarget
Closed, ResolvedPublic


Author: costellojp

When using the link parameter of the [[Image: |link=]] markup to link to an external URL the parameter $wgExternalLinkTarget is ignored.

This has occurred where a small icon image and a site title are both linked to an external site and where $wgExternalLinkTarget = '_blank' is set. Clicking on the image opens the external site in the same browser window while clicking on the textual title brings the external site up in a new browser window.

Version: 1.15.x
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:47 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz21364.
bzimport added a subscriber: Unknown Object (MLST).

plmoell wrote:


The link pass by addExternalLink() in ParserOutput.php (see makeImage() in Parser.php in « case 'link': ») but doesn't pass by makeExternalLink() in Linker.php.

To make these links to have a normal behavior, a provisional solution is on my patch (also fixing the usage of $wgNoFollowLinks, but $wgNoFollowDomainExceptions are ignored and maybe $wgNoFollowNsExceptions too). There is a hook must be applied but this hook is called in makeExternalLink().

See the introduction of "link" :


plmoell wrote:

(In reply to comment #1)
Correct diff is
(but the first one is pertinent too).