1
0
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:
David Bomba 2018-04-25 18:21:16 +10:00 committed by GitHub
parent fce6f52bed
commit e979795207
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}