Page MenuHomePhabricator

Local interwiki links with additional non-local interwiki prefixes are not interpreted as links
Closed, ResolvedPublic

Description

See https://meta.wikimedia.org/w/index.php?oldid=7485728

Since $wgLocalInterwiki = 'm' on metawiki, [[m:Test]] is correctly interpreted as a link to [[Test]].

However, for some reason, [[m:w:Test]] is not parsed as a link at all, despite being a perfectly valid alternative to [[w:Test]].


Version: 1.23.0
Severity: normal

Details

Reference
bz61357

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:52 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz61357.

Change 113329 had a related patch set uploaded by TTO:
Allow additional interwiki prefixes on local interwiki links

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

Change 113329 merged by jenkins-bot:
Allow additional interwiki prefixes on local interwiki links

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

Merged.

I cc'd a bunch of Parsoid people since this might require adjustments in Parsoid.

I'm wondering a bit what the use case for this is. It's not hard to implement in Parsoid, just not sure that we should encourage baroque interwiki prefixes like this.

You could ask: what's the use for local interwikis? This was evidently a bug in MediaWiki's handling of local interwiki links. A local interwiki link should be treated as if it didn't have the local interwiki prefix on it in the first place, and if it happends to contain an interwiki prefix, then so be it.

One of the main ues cases for this is cross-wiki code reuse/transclusion. A lot of these links ([[m:w:Foo]]) actually exist on Meta, but due to an unusual configuration, this bug never showed up there.

By the way, I'm pretty sure Parsoid never had this bug, so hopefully nothing should need to be changed.

(In reply to This, that and the other from comment #5)

One of the main ues cases for this is cross-wiki code reuse/transclusion.

I guess that makes sense for copy & paste code sharing, thanks for the explanation. Note that following such links is not very efficient, as those second-level interwikis involve another redirect which is not cached.

By the way, I'm pretty sure Parsoid never had this bug, so hopefully nothing
should need to be changed.

Indeed. Just verified that [[en:wikt:Foo]] works as expected in enwiki.