Page MenuHomePhabricator

Interwiki links shouldn't be checked for length in Title::newFromText
Open, LowPublic

Description

  1. Interwikis like [[google: ]] does not apply the same limit.
  2. Namespace info is unknown in the remote wiki: [[zh:Wikipedia:... (255 dots) ...]] can be legal on zhwiki but cannot pass length check on enwiki as an interwiki link.

A page that demonstrates the problem: https://zh.wikipedia.org/wiki/User:Liangent/bug27275

Details

Reference
bz27275

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:20 PM
bzimport set Reference to bz27275.
bzimport added a subscriber: Unknown Object (MLST).

Could you please point to real cases or examples where this is a problem?

(In reply to comment #1)

Could you please point to real cases or examples where this is a problem?

To make links on [[zh:User:Liangent/bug27275]] work.

Why is this a bug belonging to the Wikimedia product?

Sorry, I'm trying to find the right home for it (and learning while doing it).

It seems the related code is at includes / Title.php 2732-2743

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blame;f=includes/Title.php;hb=bdb325cb4ef1761417024980dbf7b6a70a3d996f#l2707

Amire80 changed the task status from Open to Stalled.Mar 4 2018, 9:14 AM
Amire80 changed the task status from Stalled to Open.
Amire80 edited projects, added MediaWiki-Interwiki; removed MediaWiki-General.
Amire80 updated the task description. (Show Details)
Amire80 updated the task description. (Show Details)
Amire80 removed subscribers: Kosikfl, wikibugs-l-list.

See w:User:PrimeHunter/Page name size in interwiki links for a nice explanation of this bug and see Template talk:Wikidata Infobox for the problems this bug is causing on Commons categories.

The code making interwiki links may not know namespaces at other wikis so it may be unable to tell whether [[:en:Foo:Bar]] is a mainspace page called "Foo:Bar" or the page "Bar" in a namespace called "Foo". That means a general solution may have to allow any title with at most 255 bytes after a colon, at least if the part before the colon doesn't exceed the maximun possible size there. That means interwiki linking may generate url's like this with 255 a's and 259 total bytes in a mainspace pagename:
https://en.wikipedia.org/wiki/Foo:Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
So it would make a clickable wikilink at the source wiki but be an invalid too long page name at the target wiki. I don't think this is a serious concern. It would happen very rarely and not cause any problems I can think of. The current situation is worse when it's impossible to make interwiki wikilinks to some valid pages outside mainspace.