Last modified: 2010-05-15 14:36:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T2719, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 719 - MediaWiki silently ignores attempts to set namespaces less than 0 or greater than 255
MediaWiki silently ignores attempts to set namespaces less than 0 or greater ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-15 06:15 UTC by Leah
Modified: 2010-05-15 14:36 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Leah 2004-10-15 06:15:19 UTC
However, it continues to process such an update, changing the namespace number
to 0 or 255, possibly destroying or duplicating content, or making pages
inaccessible.  Do the Special: or Media: namespaces work at all?  As far as I
can tell, the former is quietly redirected to MediaWiki:, and the latter to Image:.

Using an unsigned eight-bit value for namespace numbers is a terrible limitation
(it isn't even documented anywhere).  In places, the code currently assumes
negative values are legal (e.g., NS_MEDIA = -2 and NS_SPECIAL = -1).  Such a
small range will inevitably lead to namespace conflicts.  Why was cur_namespace
chosen to be a tinyint?
Comment 1 Brion Vibber 2004-10-15 06:35:40 UTC
Special and media are, well, special namespaces: no pages are stored with them.
Comment 2 Rowan Collins [IMSoP] 2004-10-15 11:13:40 UTC
And presumably the reason for only allowing such a small range is that it was
never anticipated that anyone would want more seperate namespaces than that: the
original version had, what, about half a dozen? I honestly can't think why
anyone *would* want >256 different namespaces (or perhaps think of that as 128 +
an associated _talk for each one, but even then); unless they were trying to
create a "FractalWiki"-type system, where different namespaces were treated as
though they were their own wiki, in which case I think a limit on the number of
namespaces would be the least of their problems.
Comment 3 Leah 2004-10-15 12:00:35 UTC
(In reply to comment #2)
> And presumably the reason for only allowing such a small range is that it was
> never anticipated that anyone would want more seperate namespaces than that: the
> original version had, what, about half a dozen? I honestly can't think why
> anyone *would* want >256 different namespaces (or perhaps think of that as 128 +
> an associated _talk for each one, but even then); unless they were trying to
> create a "FractalWiki"-type system, where different namespaces were treated as
> though they were their own wiki, in which case I think a limit on the number of
> namespaces would be the least of their problems.

Yes, probably.  The limit is fairly simple to adjust, even after the wiki has
been created, but it's aggravating.  It still ought to handle values outside the
set range in a way that doesn't require repairing the database by hand.

It's really easy to encounter the limit if one isn't aware of it; the code
suggests that numbers down to -15 should be valid, and most people don't think
of 256 as a nice round number.  I almost started adding custom namespaces at
1000 (thinking I'd seen that done somewhere else).  Padding namespaces to avoid
collisions later gives maybe 20-40 names until the limit, starting from 100.

FractalWiki sounds fun.  Are there wikis which support nested namespaces?
Comment 4 JeLuF 2004-10-19 05:57:42 UTC
So, what is the bug here?
What do you mean by "Set namespace less than 0"? How do you set it, SQL?
Comment 5 Leah 2004-10-19 10:52:40 UTC
Custom namespaces are defined using the $wgExtraNamespaces array. 
DefaultSettings.php provides an illustration:

# $wgExtraNamespaces =
#	array(100 => "Hilfe", 
#	      101 => "Hilfe_Diskussion",
#	      102 => "Aide", 
#	      103 => "Discussion_Aide");
Comment 6 Antoine "hashar" Musso (WMF) 2004-11-13 21:29:51 UTC
I added a comment in defaultsettings (HEAD):

# Custom namespaces should start at 100 and stop at 255 (hard limit set by database)
Comment 7 Ævar Arnfjörð Bjarmason 2005-04-24 04:00:14 UTC
Marking this as FIXED.
Comment 8 Brion Vibber 2005-04-24 04:46:35 UTC
I have no idea why this was marked fixed, as it's not.
Comment 9 Brion Vibber 2005-05-02 10:16:05 UTC
Bumping namespace fields from tinyint to int in 1.5. Checked into CVS HEAD.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links