From 803a6478886cc3ff1d93a93fbed2b8f942a86955 Mon Sep 17 00:00:00 2001
From: Spam Me <295566+styx-tdo@users.noreply.github.com>
Date: Fri, 6 Dec 2024 13:57:04 +0100
Subject: [PATCH] Fix EPP message - host requires IP addresses:
http://epp.subreg.cz/docs/?cmd=createhost
---
epp.php | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/epp.php b/epp.php
index d2dd476..ebf8006 100644
--- a/epp.php
+++ b/epp.php
@@ -573,7 +573,17 @@ public function registerDomain(Registrar_Domain $domain)
$to[] = $domain->{'get' . ucfirst($ns)}();
$from[] = '/{{ clTRID }}/';
$clTRID = str_replace('.', '', round(microtime(1), 3));
- $to[] = htmlspecialchars($this->config['registrarprefix'] . '-host-check-' . $clTRID);
+ $to[] = htmlspecialchars($this->config['registrarprefix'] . '-host-check-' . $clTRID);
+
+ $result = dns_get_record($ns,DNS_A + DNS_AAAA);
+ foreach ($result as $ip) {
+ if ($ip['ip']) {
+ $ips.="\t\t\t ".''.$ip['ip'].''."\n";
+ }else if ($ip['ipv6']) {
+ $ips.="\t\t\t ".''.$ip['ipv6'].''."\n";
+ }
+ $from[] = '/{{ ips }}/';
+ $to[] = $ips;
$xml = preg_replace($from, $to, '
{{ name }}
-
+{{ ips }}
{{ clTRID }}