Page MenuHomePhabricator

mw.Title cannot parse titles starting with a period.
Closed, ResolvedPublic

Description

Originally noticed when I viewed https://en.wikipedia.org/wiki/.186?redirect=no and got a bunch of exceptions from getting started. Maybe related to bug 50023

var t = new mw.Title( '.1' );

Error: mw.Title: Could not parse title ".1" { message="mw.Title: Could not parse title ".1"", more...}

Browser: firefox 3.5


Version: 1.22.0
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=39642

Details

Reference
bz51308

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:53 AM
bzimport set Reference to bz51308.
bzimport added a subscriber: Unknown Object (MLST).

It also kinda fails on all titles with a dot in it, due to themisguided "file extension" support it has…

(new mw.Title( 'A.B' )).getNameText()

"A"

(In reply to comment #2)

This causes the VE edit tab to not load on a page starting with only one
period.

CC'ing James :)

Unrelated bug: special:prefixindex doesnt work for '.'

https://en.wikipedia.org/w/index.php?title=Special%3APrefixIndex&prefix=.
&namespace=0

Split to bug 52010. Short version is Special:prefixindex doesn't work with prefixes that aren't valid titles. ( '.' is not a valid title because web browsers get confused and think its unix relative directory syntax)

VE team will work on this in the next few days unless someone wants to grab it from us before that. :-)

(In reply to comment #1)

It also kinda fails on all titles with a dot in it, due to themisguided "file
extension" support it has…

(new mw.Title( 'A.B' )).getNameText()

"A"

This is imho irrelevant and expected behaviour. If you call #getNameText you're explicitly asking to get the page title without any prefix it may have (which, since extensions have little meaning in MediaWiki, can be in any namespace).

You're looking for mw.Title#getMainText [1].

https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.Title-method-getMainText

  • Bug 52467 has been marked as a duplicate of this bug. ***
  • Bug 52683 has been marked as a duplicate of this bug. ***
  • Bug 51979 has been marked as a duplicate of this bug. ***

Folding back into bug 38081

  • This bug has been marked as a duplicate of bug 38081 ***