Skip to content

Commit

Permalink
perf(Transfer-period): auto-detect default transfer period
Browse files Browse the repository at this point in the history
  • Loading branch information
tulsi91 authored and KaiSchwarz-cnic committed Oct 9, 2019
1 parent 6c1ef85 commit c739637
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions registrars/ispapi/ispapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -2448,9 +2448,17 @@ function ispapi_TransferDomain($params)
unset($command["BILLINGCONTACT0"]);
}

//send PERIOD=0 for .NO and .NU domains
if (preg_match('/[.](no|nu|es)$/i', $domain)) {
$command["PERIOD"] = 0;
//auto-detect default transfer period
$queryDomainOptions_command = array(
"COMMAND" => "QueryDomainOptions",
"DOMAIN0" => $domain
);
$queryDomainOptions_response = ispapi_call($queryDomainOptions_command, ispapi_config($origparams));

$period_arry = explode (",", $queryDomainOptions_response['PROPERTY']['ZONETRANSFERPERIODS'][0]);

if ($period_arry && $period_arry[0]) {
$command["PERIOD"] = preg_replace("/([0-9]+[YM])/", "$1", $period_arry[0]);
}
//do not send contact information for gTLD (Including nTLDs)
Expand Down

0 comments on commit c739637

Please sign in to comment.