NS_CATEGORY_TALK => 'Category_talk',
);
-if( is_array( $wgExtraNamespaces ) ) {
+if( isset( $wgExtraNamespaces ) && is_array( $wgExtraNamespaces ) ) {
$wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces;
}
* forevermore. Historically, they could've probably been lowercased too,
* but some things are just too ingrained now. :)
*/
- private static $alwaysCapitalizedNamespaces = array( NS_SPECIAL, NS_MEDIAWIKI );
+ private static $alwaysCapitalizedNamespaces = array( NS_SPECIAL, NS_USER, NS_MEDIAWIKI );
/**
* Can pages in the given namespace be moved?
? $index - 1
: $index;
}
+
+ /**
+ * Returns whether the specified namespace exists
+ */
+ public static function exists( $index ) {
+ global $wgCanonicalNamespaceNames;
+ return isset( $wgCanonicalNamespaceNames[$index] );
+ }
+
/**
* Returns the canonical (English Wikipedia) name for a given index
if ( array_key_exists( $name, $xNamespaces ) ) {
return $xNamespaces[$name];
} else {
- return NULL;
+ return null;
}
}