* Fixed notice when accessing special page without read permission and whitelist...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 11 Sep 2007 14:46:04 +0000 (14:46 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 11 Sep 2007 14:46:04 +0000 (14:46 +0000)
RELEASE-NOTES
includes/Title.php

index 28cca05..72e2958 100644 (file)
@@ -54,6 +54,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Speed up Special:UncategorizedPages and Special:Deadendpages (no longer marked
   as slow queries). They now add blank ('','') entries for pages without ANY links
   or categories.
+* Fixed notice when accessing special page without read permission and whitelist
+  is not defined
 
 === API changes in 1.12 ===
 
index e9f2e20..7fc3e94 100644 (file)
@@ -1278,19 +1278,26 @@ class Title {
                        if( $this->isSpecial( 'Userlogin' ) || $this->isSpecial( 'Resetpass' ) ) {
                                return true;
                        }
+
+                       /**
+                        * Bail out if there isn't whitelist
+                        */
+                       if( !is_array($wgWhitelistRead) ) {
+                               return false;
+                       }
                        
                        /**
                         * Check for explicit whitelisting
                         */
                        $name = $this->getPrefixedText();
-                       if( $wgWhitelistRead && in_array( $name, $wgWhitelistRead, true ) )
+                       if( in_array( $name, $wgWhitelistRead, true ) )
                                return true;
                        
                        /**
                         * Old settings might have the title prefixed with
                         * a colon for main-namespace pages
                         */
-                       if( $wgWhitelistRead && $this->getNamespace() == NS_MAIN ) {
+                       if( $this->getNamespace() == NS_MAIN ) {
                                if( in_array( ':' . $name, $wgWhitelistRead ) )
                                        return true;
                        }