Last modified: 2007-06-26 07:23:40 UTC
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.
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 [details] Proposed patch
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 [details] 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.
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)