修复判断入口文件ip_check.php以及新增复制配置选项
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
/**
|
||||
* SHOW_SITE_COUNTRY 允许列表解析与比对
|
||||
*/
|
||||
require_once __DIR__ . '/CountryCodeNormalizer.php';
|
||||
|
||||
class CountryAllowlist
|
||||
{
|
||||
/**
|
||||
@@ -34,9 +36,10 @@ class CountryAllowlist
|
||||
if ($allowlist === []) {
|
||||
return true;
|
||||
}
|
||||
if ($countryCode === null || $countryCode === '') {
|
||||
$normalized = CountryCodeNormalizer::toAlpha2($countryCode);
|
||||
if ($normalized === null || $normalized === '') {
|
||||
return false;
|
||||
}
|
||||
return in_array(strtoupper($countryCode), $allowlist, true);
|
||||
return in_array($normalized, $allowlist, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user