Add support for international domain names. Note that this relies on php-intl to be installed

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-01-12 13:33:05 +01:00
parent 5eadd346b9
commit 65be9d89ef
4 changed files with 33 additions and 15 deletions

View File

@@ -16,17 +16,23 @@ if (empty($api)) {
list_verify($list);
}
// Split individual domains into array
$domains = preg_split('/\s+/', trim($_POST['domain']));
$comment = trim($_POST['comment']);
// Convert domain name to IDNA ASCII form for international domains
foreach($domains as &$domain)
{
$domain = idn_to_ascii($domain);
}
// Only check domains we add to the exact lists.
// Regex are validated by FTL during import
$check_lists = ["white","black","audit"];
if(in_array($list, $check_lists)) {
check_domain();
check_domain($domains);
}
// Split individual domains into array
$domains = preg_split('/\s+/', trim($_POST['domain']));
$comment = trim($_POST['comment']);
require_once("func.php");
require_once("database.php");
$GRAVITYDB = getGravityDBFilename();