diff --git a/library/think/Lang.php b/library/think/Lang.php index a7ac042c..23887a2c 100644 --- a/library/think/Lang.php +++ b/library/think/Lang.php @@ -211,7 +211,7 @@ class Lang } } - if (preg_match('/^([a-z\d\-]+)/i', $langSet, $matches)) { + if (preg_match('/^([a-z0-9\-_]{2,10})$/i', $langSet, $matches)) { $langSet = strtolower($matches[1]); } else { $langSet = self::$range;