Last modified: 2010-05-15 15:32:54 UTC
Looking at Language.php, it is clear that we now have 16 + 2 = 18 namespaces.
Yet in DefaultSettings.php, you do not initialise all the elements in the
$wgNamespacesWithSubpages = array( -1 => 0, 0 => 0, 1 => 1,
2 => 1, 3 => 1, 4 => 0, 5 => 1, 6 => 0, 7 => 1, 8 => 0, 9 => 1, 10 => 0, 11 => 1);
which is only the first 12 namespaces plus Special.
As a good programming practise, it would be appropriate to initialise ALL values in this array to
something meaningful. Currently namespaces -2 (Media), and 12-15 (Help, Help_Talk, Category and
Category_Talk) do not get a specifically assigned entry in the array.
The next statement in DefaultSettings.php relating to $wgNamespacesToBeSearchedDefault has a
I think this stems from the growth of MediaWiki from 12 to 16 namespaces (plus the two negative-
numbered special spaces).
And while the comment above these two statements says
# See Language.php for a list of namespaces.
It would also make some sense to provide a pointer to a list of the namespace NUMBERS, which is,
after all, what the arrays are initialised using (rather than namespace NAMES). These definitions
are laid out in module Defines.php
iirc these arrays need only include positive entries; anything else (including custom
namespaces) will be taken as negative.
Unless it's triggering uninitialized array item access notices this is just a code
readability issue; adding to the code quality tracking bug 700.
The default values for the arrays should include only positive entries and use the NS_*
Done. Also switched from 1 to true.