throw new MWException( __METHOD__ . " must be passed a string, $type given$addmsg" );
}
- return (bool)preg_match( '/^[a-z0-9-]{2,}$/i', $code );
+ return (bool)preg_match( '/^[a-z0-9-]{2,}$/', $code );
}
/**
function initContLang() {
}
- /**
- * Same as getFallbacksFor for current language.
- * @return array|bool
- * @deprecated since 1.19
- */
- function getFallbackLanguageCode() {
- wfDeprecated( __METHOD__, '1.19' );
-
- return self::getFallbackFor( $this->mCode );
- }
-
/**
* @return array
* @since 1.19
include "$IP/languages/Names.php";
}
+ // If passed an invalid language code to use, fallback to en
+ if ( $inLanguage !== null && !Language::isValidCode( $inLanguage ) ) {
+ $inLanguage = 'en';
+ }
+
$names = array();
if ( $inLanguage ) {