From af5d418e822e7198e0d393826e9e722b613ca21a Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 5 Apr 2016 12:49:55 -0700 Subject: [PATCH] ImageListPager: Fix improper use of Title::newFromText(). The $defaultNamespace parameter to Title::newFromText() only applies if a namespace prefix isn't included in the text. So if a username was "Help:FooBar", the NS_USER prefix would not be applied. Instead use Title::makeTitleSafe( NS_USER, ... ); which was designed for this specific purpose. Change-Id: Iafce73d352887947e61ae7c906ddf965e04fbf6f --- includes/specials/pagers/ImageListPager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php index 48f60caf15..258ac8316c 100644 --- a/includes/specials/pagers/ImageListPager.php +++ b/includes/specials/pagers/ImageListPager.php @@ -54,7 +54,7 @@ class ImageListPager extends TablePager { $this->mShowAll = $showAll; if ( $userName !== null && $userName !== '' ) { - $nt = Title::newFromText( $userName, NS_USER ); + $nt = Title::makeTitleSafe( NS_USER, $userName ); if ( is_null( $nt ) ) { $this->outputUserDoesNotExist( $userName ); } else { -- 2.20.1