mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 00:11:35 +02:00
test cloudflare record exists (#2052)
This commit is contained in:
parent
fce6f52bed
commit
e979795207
@ -48,6 +48,10 @@ class Cloudflare
|
||||
|
||||
$dnsRecordId = self::getDNSRecord($zone, $account->subdomain);
|
||||
|
||||
//test record exists
|
||||
if($dnsRecordId == 0)
|
||||
return;
|
||||
|
||||
$jsonEncodedData = json_encode([]);
|
||||
|
||||
$requestType = 'DELETE';
|
||||
@ -89,7 +93,10 @@ class Cloudflare
|
||||
if ($response['status'] != 200)
|
||||
Utils::logError('Unable to get the record ID for ' . $aRecord . ' @ Cloudflare - ' . $response['result']['result']);
|
||||
|
||||
if(isset($response['result']['result'][0]))
|
||||
return $response['result']['result'][0]['id'];
|
||||
else
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user