Page MenuHomePhabricator

SpecialAllpages.php returns results for unknown namespaces
Closed, ResolvedPublic

Description

I have discovered SpecialAllpages.php goes ahead and returns results
for unknown namespaces:

$ for NS in seq -8 1 8; do printf %2i: $NS;

wget -O - http://some_wiki/index.php?title=Special%3AAllpages\&namespace=$NS -q|
wc -wc; done

-8: 995 35434
-7: 995 35434
-6: 995 35434
-5: 995 35434
-4: 995 35434
-3: 995 35434
-2: 528 8515
-1: 528 8515
0: 995 35433
1: 553 9659
2: 535 8816
3: 534 8680
4: 551 9795
5: 548 9392
6: 529 8584
7: 531 8594
8: 533 8771

It should say "Unknown namespace" instead of interpreting an empty
match as NULL==0 or whatever.


Version: 1.11.x
Severity: trivial

Details

Reference
bz10160

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:51 PM
bzimport set Reference to bz10160.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

This is what we call graceful failure.

Marking it as INVALID, we fallback to NS_MAIN (0) and the list box display
correctly. Showing an error message seems unhelpful.

Showing an error message sounds entirely helpful -- then you know what's wrong instead of sitting there going "what the heck".

Created attachment 3809
Proposed patch

attachment allpages_ns.patch ignored as obsolete

robchur wrote:

I would suggest not aborting outright, but showing the error message, e.g. "Invalid namespace selected." and then proceeding to show the form, perhaps defaulting to the main namespace as usual, so the user can correct the selection without hitting the back button or correcting the URL.

Created attachment 3813
New patch

(In reply to comment #5)

I would suggest not aborting outright, but showing the error message, e.g.
"Invalid namespace selected." and then proceeding to show the form, perhaps
defaulting to the main namespace as usual, so the user can correct the
selection without hitting the back button or correcting the URL.

Fixed this in new patch.

Attached:

robchur wrote:

Error message text needs to be changed, message is handled as HTML; either have it parsed, or make sure it's escaped.

Fixed in r23413 with some other tweakings (use of XML functions, RTL wikis)