Help:Regexp wgWhitelistRead
From MMVLWiki
This hack makes entries in the array '$wgWiteListRead' be interpreted as regular expressions. The file include/Title.php has been changed as follows:
/** * Can $wgUser read this page? * @return boolean * @access public */ function userCanRead() { global $wgUser; if( $wgUser->isAllowed('read') ) { return true; } else { global $wgWhitelistRead; /** If anon users can create an account, they need to reach the login page first! */ if( $wgUser->isAllowed( 'createaccount' ) && $this->getNamespace() == NS_SPECIAL && $this->getText() == 'Userlogin' ) { return true; } /** some pages are explicitly allowed */ $name = $this->getPrefixedText(); # Jan Wedekind: Changed this. # if( in_array( $name, $wgWhitelistRead ) ) { # return true; #} if ( is_array($wgWhitelistRead) ) { for ($i=0; $i<count($wgWhitelistRead); $i++) { if (preg_match($wgWhitelistRead[$i],$name)) { return true; } } } # Compatibility with old settings if( $this->getNamespace() == NS_MAIN ) { if( in_array( ':' . $name, $wgWhitelistRead ) ) { return true; } } } return false; }