EPP check improvements

This commit is contained in:
Pinga 2025-05-02 12:16:31 +03:00
parent 1f3fc19919
commit 2dff2f9b10

View file

@ -76,7 +76,12 @@ function processHostCheck($conn, $db, $xml, $trans) {
foreach ($hosts as $host) {
$host = (string)$host;
if (preg_match('/^\.[a-z]{2,}$/i', $host) || preg_match('/^[a-z]{2,}$/i', $host)) {
if (
strpos($host, '.') === false || // No dot = not FQDN
preg_match('/^\./', $host) || // Starts with dot
preg_match('/^-/', $host) || // Starts with dash
preg_match('/[^\w.-]/', $host) // Invalid characters
) {
sendEppError($conn, $db, 2306, 'Host name must be fully qualified (FQDN)', $clTRID, $trans);
return;
}