Page MenuHomePhabricator

Invalid pagename in URL gives "Fatal error" rather than failing gracefully
Closed, ResolvedPublic

Description

Author: spam

Description:
I accessed a wikipage in a special namespace. Trying to return to some kind of
index-page i removed the part after the colon an got an PHP Error:

Fatal error: Call to a member function on a non-object in
/usr/local/apache/common-local/php-1.4/index.php on line 50

I tried it with
http://en.wikipedia.org/wiki/Wikipedia:
http://en.wikipedia.org/wiki/Special:
http://en.wikipedia.org/wiki/Media:


Version: 1.4.x
Severity: trivial
URL: http://en.wikipedia.org/wiki/Wikipedia:

Details

Reference
bz1899

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 8:18 PM
bzimport set Reference to bz1899.
bzimport added a subscriber: Unknown Object (MLST).

rowan.collins wrote:

Hm. I guess the title code is trying to look up a page with no name (just a
namespace) and failing, and the display code is not checking for this condition.
Testing reveals that other invalid pages behave the same, e.g.
http://en.wikipedia.org/wiki/%2b

The line in question just needs a check like "if(!$wgTitle)", initialising some
"invalid pagename" text, which I have a feeling we already have for other purposes.

Broken code in the variant handling. I've reverted the change again pending correct fixes in that code.