mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-21 10:06:05 +02:00
More EPP fixes
This commit is contained in:
parent
8d3493bb7a
commit
55a1950351
2 changed files with 13 additions and 14 deletions
|
@ -14,25 +14,24 @@ function processContactCheck($conn, $db, $xml, $trans) {
|
|||
|
||||
foreach ($contactIDs as $contactID) {
|
||||
$contactID = (string)$contactID;
|
||||
$entry = [$contactID];
|
||||
|
||||
$invalid_identifier = validate_identifier($contactID);
|
||||
|
||||
if ($invalid_identifier) {
|
||||
$entry[] = 0;
|
||||
$entry[] = $invalid_identifier;
|
||||
} else {
|
||||
sendEppError($conn, $db, 2306, $invalid_identifier, $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
$entry = [$contactID];
|
||||
|
||||
$stmt = $db->prepare("SELECT 1 FROM contact WHERE identifier = :id");
|
||||
$stmt->execute(['id' => $contactID]);
|
||||
$available = $stmt->fetch() ? '0' : '1';
|
||||
$stmt->closeCursor();
|
||||
|
||||
$entry[] = $available;
|
||||
|
||||
if (!$available) {
|
||||
$entry[] = "In use";
|
||||
}
|
||||
}
|
||||
|
||||
$ids[] = $entry;
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ function validate_label($domain, $pdo) {
|
|||
return 'Invalid domain name format: must contain at least one dot (.)';
|
||||
}
|
||||
if ($domain[0] === '.' || substr($domain, -1) === '.') {
|
||||
return 'Invalid domain name format: cannot start or end with a dot (.)';
|
||||
return 'Cannot start or end with dot';
|
||||
}
|
||||
|
||||
// Split domain into labels (subdomains, SLD, TLD)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue