testPngNativetZtxt requires zlib extension
[lhc/web/wiklou.git] / includes / SpecialPageFactory.php
index fa1bca4..5e5d1fc 100644 (file)
@@ -119,7 +119,7 @@ class SpecialPageFactory {
                'Upload'                    => 'SpecialUpload',
                'UploadStash'               => 'SpecialUploadStash',
 
-               // Wiki data and tools
+               // Data and tools
                'Statistics'                => 'SpecialStatistics',
                'Allmessages'               => 'SpecialAllmessages',
                'Version'                   => 'SpecialVersion',
@@ -336,7 +336,7 @@ class SpecialPageFactory {
         * Find the object with a given name and return it (or NULL)
         *
         * @param $name String Special page name, may be localised and/or an alias
-        * @return SpecialPage object or null if the page doesn't exist
+        * @return SpecialPage|null SpecialPage object or null if the page doesn't exist
         */
        public static function getPage( $name ) {
                list( $realName, /*...*/ ) = self::resolveAlias( $name );
@@ -371,12 +371,10 @@ 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->setContext( $context );
+                               $page->setContext( RequestContext::getMain() );
                                if ( $page->isListed()
                                        && ( !$page->isRestricted() || $page->userCanExecute( $user ) )
                                ) {