mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-09 12:33:23 +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;
|
$nsArr[$addr_type][$addr] = $addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||||
$internal_host = false;
|
$internal_host = false;
|
||||||
|
foreach ($tlds as $tld) {
|
||||||
$query = "SELECT tld FROM domain_tld";
|
if (str_ends_with($hostName, strtolower($tld))) {
|
||||||
foreach ($db->query($query) as $row) {
|
|
||||||
if (preg_match("/" . preg_quote(strtoupper($row['tld']), '/') . "$/i", $hostName)) {
|
|
||||||
$internal_host = true;
|
$internal_host = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1031,18 +1030,14 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the host is internal or external
|
// Check if the host is internal or external
|
||||||
|
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||||
$internal_host = false;
|
$internal_host = false;
|
||||||
$stmt = $db->prepare("SELECT tld FROM domain_tld");
|
foreach ($tlds as $tld) {
|
||||||
$stmt->execute();
|
if (str_ends_with($hostName, strtolower($tld))) {
|
||||||
while ($tld = $stmt->fetchColumn()) {
|
|
||||||
$tld = strtoupper($tld);
|
|
||||||
$escapedTld = preg_quote($tld, '/');
|
|
||||||
if (preg_match("/$escapedTld$/i", $hostName)) {
|
|
||||||
$internal_host = true;
|
$internal_host = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$stmt->closeCursor();
|
|
||||||
|
|
||||||
if ($internal_host) {
|
if ($internal_host) {
|
||||||
if (preg_match('/\.' . preg_quote($domainName, '/') . '$/i', $hostName)) {
|
if (preg_match('/\.' . preg_quote($domainName, '/') . '$/i', $hostName)) {
|
||||||
|
|
|
@ -928,17 +928,14 @@ function processHostUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||||
$internal_host = false;
|
$internal_host = false;
|
||||||
$stmt = $db->prepare("SELECT tld FROM domain_tld");
|
foreach ($tlds as $tld) {
|
||||||
$stmt->execute();
|
if (str_ends_with(strtolower($chg_name), strtolower($tld))) {
|
||||||
while ($row = $stmt->fetch()) {
|
|
||||||
$tld = preg_quote(strtolower($row['tld']), '/');
|
|
||||||
if (preg_match("/$tld\$/i", strtolower($chg_name))) {
|
|
||||||
$internal_host = true;
|
$internal_host = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$stmt->closeCursor();
|
|
||||||
|
|
||||||
if ($internal_host) {
|
if ($internal_host) {
|
||||||
sendEppError($conn, $db, 2005, 'Out-of-bailiwick change not allowed: host must be external to registry-managed domains', $clTRID, $trans);
|
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