X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=blobdiff_plain;f=includes%2FNamespace.php;h=9662fc895e4c648112b52cadedbd737a845c3bed;hb=181641792a275e6b7a8bca24393d683e578fadca;hp=c87a12b7c08089a8713d377894a8758c57ade70d;hpb=cf11d9d95b158a640d957520c9ffd866a554126f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Namespace.php b/includes/Namespace.php index c87a12b7c0..9662fc895e 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -209,12 +209,14 @@ class MWNamespace { * Returns array of all defined namespaces with their canonical * (English) names. * + * @param bool $rebuild rebuild namespace list (default = false). Used for testing. + * * @return array * @since 1.17 */ - public static function getCanonicalNamespaces() { + public static function getCanonicalNamespaces( $rebuild = false ) { static $namespaces = null; - if ( $namespaces === null ) { + if ( $namespaces === null || $rebuild ) { global $wgExtraNamespaces, $wgCanonicalNamespaceNames; $namespaces = array( NS_MAIN => '' ) + $wgCanonicalNamespaceNames; if ( is_array( $wgExtraNamespaces ) ) {