Fixed getUsablePages() to account for the fact that getPage() can return null
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 8 Oct 2011 00:16:31 +0000 (00:16 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 8 Oct 2011 00:16:31 +0000 (00:16 +0000)
includes/SpecialPageFactory.php

index eb19200..22aaa75 100644 (file)
@@ -346,11 +346,9 @@ class SpecialPageFactory {
                $pages = array();
                foreach ( self::getList() as $name => $rec ) {
                        $page = self::getPage( $name );
-                       if ( $page->isListed()
-                               && (
-                                       !$page->isRestricted()
-                                       || $page->userCanExecute( $wgUser )
-                               )
+                       if ( $page // not null
+                               && $page->isListed()
+                               && ( !$page->isRestricted() || $page->userCanExecute( $wgUser ) )
                        ) {
                                $pages[$name] = $page;
                        }