Page MenuHomePhabricator

Notices generated when referencing non-existant namespaces.
Closed, ResolvedPublic

Description

Author: Astronouth7303

Description:
On my own private wiki, when I use the code (seen in the URL), it generates PHP
notices:
Notice: Undefined offset: -3 in D:\XAMPP\htdocs\w\languages\Language.php on
line 1727
Notice: Undefined offset: 16 in D:\XAMPP\htdocs\w\languages\Language.php on
line 1727
Notice: Undefined offset: 17 in D:\XAMPP\htdocs\w\languages\Language.php on
line 1727
Notice: Undefined offset: 102 in D:\XAMPP\htdocs\w\languages\Language.php on
line 1727
Notice: Undefined offset: 103 in D:\XAMPP\htdocs\w\languages\Language.php on
line 1727

This is most likely from the {{ns:-3}}, {{ns:16}}, {{ns:17}}, etc. that appear
on the page.

The line in question is in getNsText(), which is:

		return $wgNamespaceNamesEn[$index];

A check should be added to make sure that the namespace actually exists.


Version: 1.4.x
Severity: normal
OS: Windows XP
Platform: PC
URL: http://en.wikipedia.org/wiki/User:Astronouth7303/Namespaces

Details

Reference
bz2321

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:30 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz2321.
bzimport added a subscriber: Unknown Object (MLST).
  • This bug has been marked as a duplicate of 2287 ***