Update epp-update.php

This commit is contained in:
Pinga 2025-05-13 21:54:18 +03:00
parent c42213b513
commit 6d297e4a7b

View file

@ -929,21 +929,21 @@ function processHostUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
$chg_clid = $stmt->fetchColumn(); $chg_clid = $stmt->fetchColumn();
$stmt->closeCursor(); $stmt->closeCursor();
if ($chg_clid === false) {
sendEppError($conn, $db, 2303, 'Superordinate domain does not exist: ' . $chg_domain, $clTRID, $trans);
return;
}
if ($chg_clid !== false && $chg_clid !== $clid) { if ($chg_clid !== false && $chg_clid !== $clid) {
sendEppError($conn, $db, 2304, 'Host rename denied: domain owned by another registrar', $clTRID, $trans); sendEppError($conn, $db, 2304, 'Host rename denied: domain owned by another registrar', $clTRID, $trans);
return; return;
} }
$stmt = $db->prepare("SELECT name FROM domain WHERE id = ? LIMIT 1"); $stmt = $db->prepare("SELECT name FROM domain WHERE id = ? LIMIT 1");
$stmt->execute([$domain_id]); $stmt->execute([$domain_id]);
$domain_name = $stmt->fetchColumn(); $domain_name = $stmt->fetchColumn();
$stmt->closeCursor(); $stmt->closeCursor();
if ($chg_domain !== null && $chg_clid === false) {
sendEppError($conn, $db, 2303, 'Superordinate domain does not exist: ' . $chg_domain, $clTRID, $trans);
return;
}
if (!preg_match('/\.' . preg_quote($domain_name, '/') . '$/i', strtolower($chg_name))) { if (!preg_match('/\.' . preg_quote($domain_name, '/') . '$/i', strtolower($chg_name))) {
$stmt = $db->prepare("DELETE FROM host_addr WHERE host_id = ?"); $stmt = $db->prepare("DELETE FROM host_addr WHERE host_id = ?");
$stmt->execute([$host_id]); $stmt->execute([$host_id]);