From: Aaron Schulz Date: Sun, 25 Nov 2012 00:39:48 +0000 (-0800) Subject: Stopped some debug notice warnings from showing on SpecialPages. X-Git-Tag: 1.31.0-rc.0~21514^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=9737de859090c8596a530b53088f9492e146fc7f;p=lhc%2Fweb%2Fwiklou.git Stopped some debug notice warnings from showing on SpecialPages. Change-Id: I9b7fdf3a714b806ac28bd28c5c43951e2a5f1f64 --- diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php index 8ed52642a7..fa1bca486b 100644 --- a/includes/SpecialPageFactory.php +++ b/includes/SpecialPageFactory.php @@ -371,13 +371,17 @@ class SpecialPageFactory { global $wgUser; $user = $wgUser; } + $context = RequestContext::newExtraneousContext( Title::newMainPage() ); + $context->setUser( $user ); foreach ( self::getList() as $name => $rec ) { $page = self::getPage( $name ); - if ( $page // not null - && $page->isListed() - && ( !$page->isRestricted() || $page->userCanExecute( $user ) ) - ) { - $pages[$name] = $page; + if ( $page ) { // not null + $page->setContext( $context ); + if ( $page->isListed() + && ( !$page->isRestricted() || $page->userCanExecute( $user ) ) + ) { + $pages[$name] = $page; + } } } return $pages;