mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-14 08:37:00 +02:00
Fixed #58; also other minor bugs removed
This commit is contained in:
parent
0a4afa6c98
commit
dd17c0b873
8 changed files with 61 additions and 14 deletions
|
@ -266,8 +266,9 @@ function processDomainCheck($conn, $db, $xml, $trans) {
|
|||
if ($allocation_token !== null) {
|
||||
$allocationTokenValue = (string)$allocation_token;
|
||||
|
||||
$stmt = $db->prepare("SELECT token FROM allocation_tokens WHERE domain_name = :domainName LIMIT 1");
|
||||
$stmt = $db->prepare("SELECT token FROM allocation_tokens WHERE domain_name = :domainName AND token = :token LIMIT 1");
|
||||
$stmt->bindParam(':domainName', $label, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':token', $allocationTokenValue, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
$token = $stmt->fetchColumn();
|
||||
|
||||
|
|
|
@ -625,8 +625,9 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
if ($allocation_token !== null) {
|
||||
$allocationTokenValue = (string)$allocation_token;
|
||||
|
||||
$stmt = $db->prepare("SELECT token FROM allocation_tokens WHERE domain_name = :domainName LIMIT 1");
|
||||
$stmt = $db->prepare("SELECT token FROM allocation_tokens WHERE domain_name = :domainName AND token = :token LIMIT 1");
|
||||
$stmt->bindParam(':domainName', $label, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':token', $allocationTokenValue, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
$token = $stmt->fetchColumn();
|
||||
|
||||
|
|
|
@ -756,8 +756,9 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
|||
if ($allocation_token !== null) {
|
||||
$allocationTokenValue = (string)$allocation_token;
|
||||
|
||||
$stmt = $db->prepare("SELECT token FROM allocation_tokens WHERE domain_name = :domainName LIMIT 1");
|
||||
$stmt = $db->prepare("SELECT token FROM allocation_tokens WHERE domain_name = :domainName AND token = :token LIMIT 1");
|
||||
$stmt->bindParam(':domainName', $domainName, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':token', $allocationTokenValue, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
$token = $stmt->fetchColumn();
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ function extractDomainAndTLD($urlString) {
|
|||
foreach ($testTlds as $testTld) {
|
||||
if (str_ends_with($host, "$testTld")) {
|
||||
// Handle the test TLD case
|
||||
$tldLength = strlen($testTld) + 1; // +1 for the dot
|
||||
$tldLength = strlen($testTld); // No +1 for the dot
|
||||
$hostWithoutTld = substr($host, 0, -$tldLength);
|
||||
$hostParts = explode('.', $hostWithoutTld);
|
||||
$sld = array_pop($hostParts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue