mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-23 11:05:57 +02:00
RST improvements
This commit is contained in:
parent
7f064e4838
commit
d755704917
1 changed files with 11 additions and 24 deletions
|
@ -1313,20 +1313,16 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Additional checks related to domain TLDs and existing records
|
// Additional checks related to domain TLDs and existing records
|
||||||
if (validateHostName($hostObj)) {
|
if (validateHostName($hostObj)) {
|
||||||
$stmt = $db->prepare("SELECT tld FROM domain_tld");
|
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||||
$stmt->execute();
|
$internal_host = false;
|
||||||
$tlds = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
|
||||||
$stmt->closeCursor();
|
|
||||||
$host_from_this_registry = 0;
|
|
||||||
foreach ($tlds as $tld) {
|
foreach ($tlds as $tld) {
|
||||||
$tld = preg_quote(strtoupper($tld), '/');
|
if (str_ends_with(strtolower($hostObj), strtolower($tld))) {
|
||||||
if (preg_match("/$tld$/i", $hostObj)) {
|
$internal_host = true;
|
||||||
$host_from_this_registry = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($host_from_this_registry) {
|
if ($internal_host) {
|
||||||
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
||||||
$superordinate_domain = 1;
|
$superordinate_domain = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1690,25 +1686,16 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt->execute([$logMessage, $contextData]);
|
$stmt->execute([$logMessage, $contextData]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$host_from_this_registry = 0;
|
$tlds = $db->query("SELECT tld FROM domain_tld")->fetchAll(PDO::FETCH_COLUMN);
|
||||||
|
$internal_host = false;
|
||||||
$sth = $db->prepare("SELECT tld FROM domain_tld");
|
foreach ($tlds as $tld) {
|
||||||
if (!$sth->execute()) {
|
if (str_ends_with(strtolower($hostObj), strtolower($tld))) {
|
||||||
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
$internal_host = true;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$tld = strtoupper($row['tld']);
|
|
||||||
$tld = str_replace('.', '\\.', $tld);
|
|
||||||
if (preg_match("/{$tld}$/i", $hostObj)) {
|
|
||||||
$host_from_this_registry = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sth->closeCursor();
|
|
||||||
|
|
||||||
if ($host_from_this_registry) {
|
if ($internal_host) {
|
||||||
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
||||||
$sth = $db->prepare("INSERT INTO host (name,domain_id,clid,crid,crdate) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP(3))");
|
$sth = $db->prepare("INSERT INTO host (name,domain_id,clid,crid,crdate) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
if (!$sth->execute([$hostObj, $domain_id, $clid, $clid])) {
|
if (!$sth->execute([$hostObj, $domain_id, $clid, $clid])) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue