Merge pull request #874 from nextcloud/fix/872/ipv6-domain-validatioin

domain validation should be compatible with ipv6 only as well
This commit is contained in:
Simon L 2022-06-30 16:11:02 +02:00 committed by GitHub
commit 86f15d0911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,6 +203,13 @@ class ConfigurationManager
$dnsRecordIP = '';
}
if (empty($dnsRecordIP)) {
$record = dns_get_record($domain, DNS_AAAA);
if (!empty($record)) {
$dnsRecordIP = $record[0]['ipv6'];
}
}
// Validate IP
if(!filter_var($dnsRecordIP, FILTER_VALIDATE_IP)) {
throw new InvalidSettingConfigurationException("DNS config is not set for this domain or the domain is not a valid domain! (It was found to be set to '" . $dnsRecordIP . "')");