Throw exception on wrong type in Language::isValidCode( $code )
[lhc/web/wiklou.git] / languages / Language.php
index 5ac2882..aaaf2a2 100644 (file)
@@ -386,6 +386,7 @@ class Language {
         */
        public static function isValidCode( $code ) {
                static $cache = [];
+               Assert::parameterType( 'string', $code, '$code' );
                if ( !isset( $cache[$code] ) ) {
                        // People think language codes are html safe, so enforce it.
                        // Ideally we should only allow a-zA-Z0-9-