修复判断入口文件ip_check.php以及新增复制配置选项

This commit is contained in:
root
2026-06-15 16:53:05 +08:00
parent 8f46a4c1c4
commit 1a52201ec7
23 changed files with 969 additions and 35 deletions
+5 -2
View File
@@ -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);
}
}