Page MenuHomePhabricator

Improper handling of invalid titles in some special pages
Closed, ResolvedPublic

Description

Author: ycombarnous

Description:
Just upgraded to 1.11 from 1.10.
When going to some special pages, I get the following error

Call to a member function getPrefixedText() on a non-object in D:\\websites\\mediawiki\\includes\\SpecialFewestrevisions.php on line 47, referer: http://localhost/wiki/index.php?title=Special:Specialpages

This also happens in SpecialFewestrevisions.php on line 47
and PageQueryPage.php on line 22


Version: 1.11.x
Severity: major

Details

Reference
bz11285

Event Timeline

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

ycombarnous wrote:

*MW 1.11.0 (upgraded from 1.10.1)
*PHP 5.2.1
*Windows 2003
*XCache 1.2.0 ($wgMainCacheType = "CACHE_ACCEL")

ycombarnous wrote:

OK, I debugged that.
I had a page in MW 1.9.2 that got no title.

Since MW 1.10.0, the following pages no longer worked even though it worked in 1.9.X:
-Dead-end pages
-Orphaned pages
-Pages without language links
-Uncategorized pages

I fixed that by running cleanupTitles.php (I had to do a Control-C after 5 minutes as the script wouldn't end, but it worked still).

robchur wrote:

Improper handling of invalid titles in special pages constitutes a bug - normal procedure is to escape the page_title equivalent and present it to the user in plain text with a short message.

ycombarnous wrote:

Ok: to reproduce, put a "null" on any row in page.page_title.
The page on which you do that should of course qualify as dead-end or orphaned page, etc....

On MW 1.9, I got a strange list where item 1 & 2 would merge, the rest being normal.
On MW 1.10 & 1.11, I got above error message.

nicdumz wrote:

proposed patch

QueryPage.php states, for makeTitle & makeTitleSafe :
// @return Title the new object, or NULL on an error

And actually, the return value of these functions was never really being checked in any of these Specialpages.

attachment 11285.diff ignored as obsolete

nicdumz wrote:

proposed patch, tabs instead of spaces

Oops, was my first patch here; apparently you'd prefer tabs, here is a patch using tabs ;)

Attached:

Fixed in r41673, r41677, and r41726 by Mr.Z-man.