* @param $index int Index to check
* @return bool
*/
- public static function isNonincludableNamespace( $index ) {
+ public static function isNonincludable( $index ) {
global $wgNonincludableNamespaces;
return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces );
}
$data[$ns]['content'] = '';
}
- if ( MWNamespace::isNonincludableNamespace( $ns ) ) {
+ if ( MWNamespace::isNonincludable( $ns ) ) {
$data[$ns]['nonincludable'] = '';
}
}
$isHTML = true;
$this->disableCache();
}
- } elseif ( MWNamespace::isNonincludableNamespace( $title->getNamespace() ) ) {
+ } elseif ( MWNamespace::isNonincludable( $title->getNamespace() ) ) {
$found = false; # access denied
wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() );
} else {
}
+ public function testIsNonincludable() {
+ global $wgNonincludableNamespaces;
+ $wgNonincludableNamespaces = array( NS_USER );
+
+ $this->assertTrue( MWNamespace::isNonincludable( NS_USER ) );
+
+ $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) );
+ }
+
####### HELPERS ###########################################################
function __call( $method, $args ) {
// Call the real method if it exists