mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-10 16:58:34 +02:00
Small correction on custom phases
This commit is contained in:
parent
eab0e93417
commit
af3aa49d9c
1 changed files with 7 additions and 1 deletions
|
@ -165,13 +165,19 @@ function processDomainCheck($conn, $db, $xml, $trans) {
|
|||
if ($launchPhaseText === 'custom') {
|
||||
$launchPhaseName = (string) $xml->xpath('//launch:phase/@name')[0];
|
||||
|
||||
if (!preg_match('/^[a-zA-Z0-9_-]+$/', $launchPhaseName)) {
|
||||
sendEppError($conn, $db, 2005, 'Error in launch phase name', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
$names = [];
|
||||
foreach ($domains as $domain) {
|
||||
$domainName = (string) $domain;
|
||||
|
||||
// Check if the domain is already taken
|
||||
$stmt = $db->prepare("SELECT name FROM domain WHERE name = :domainName");
|
||||
$stmt = $db->prepare("SELECT name FROM domain WHERE name = :domainName AND tm_phase = :phase");
|
||||
$stmt->bindParam(':domainName', $domainName, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':phase', $launchPhaseName, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
$taken = $stmt->fetchColumn();
|
||||
$availability = $taken ? '0' : '1';
|
||||
|
|
Loading…
Add table
Reference in a new issue