Relax Language::isValidCode() to avoid breaking uselang hacks
[lhc/web/wiklou.git] / languages / Language.php
index edd607b..3b87db7 100644 (file)
@@ -196,7 +196,7 @@ class Language {
         * not it exists.
         */
        public static function isValidCode( $code ) {
-               return (bool)preg_match( '/^[a-z-]+$/', $code );
+               return strcspn( $code, "/\\\000" ) === strlen( $code );
        }
 
        /**