mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-08 20:13:24 +02:00
RST improvement
This commit is contained in:
parent
ce1659fba8
commit
7f064e4838
2 changed files with 9 additions and 17 deletions
|
@ -470,11 +470,10 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
$nsArr[$addr_type][$addr] = $addr;
|
||||
}
|
||||
|
||||
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||
$internal_host = false;
|
||||
|
||||
$query = "SELECT tld FROM domain_tld";
|
||||
foreach ($db->query($query) as $row) {
|
||||
if (preg_match("/" . preg_quote(strtoupper($row['tld']), '/') . "$/i", $hostName)) {
|
||||
foreach ($tlds as $tld) {
|
||||
if (str_ends_with($hostName, strtolower($tld))) {
|
||||
$internal_host = true;
|
||||
break;
|
||||
}
|
||||
|
@ -1031,18 +1030,14 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
|
|||
}
|
||||
|
||||
// Check if the host is internal or external
|
||||
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||
$internal_host = false;
|
||||
$stmt = $db->prepare("SELECT tld FROM domain_tld");
|
||||
$stmt->execute();
|
||||
while ($tld = $stmt->fetchColumn()) {
|
||||
$tld = strtoupper($tld);
|
||||
$escapedTld = preg_quote($tld, '/');
|
||||
if (preg_match("/$escapedTld$/i", $hostName)) {
|
||||
foreach ($tlds as $tld) {
|
||||
if (str_ends_with($hostName, strtolower($tld))) {
|
||||
$internal_host = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
if ($internal_host) {
|
||||
if (preg_match('/\.' . preg_quote($domainName, '/') . '$/i', $hostName)) {
|
||||
|
|
|
@ -928,17 +928,14 @@ function processHostUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||
$internal_host = false;
|
||||
$stmt = $db->prepare("SELECT tld FROM domain_tld");
|
||||
$stmt->execute();
|
||||
while ($row = $stmt->fetch()) {
|
||||
$tld = preg_quote(strtolower($row['tld']), '/');
|
||||
if (preg_match("/$tld\$/i", strtolower($chg_name))) {
|
||||
foreach ($tlds as $tld) {
|
||||
if (str_ends_with(strtolower($chg_name), strtolower($tld))) {
|
||||
$internal_host = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
if ($internal_host) {
|
||||
sendEppError($conn, $db, 2005, 'Out-of-bailiwick change not allowed: host must be external to registry-managed domains', $clTRID, $trans);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue