Skip to content

Commit

Permalink
Merge pull request #30 from exonet/tsi/multiple-txt-values
Browse files Browse the repository at this point in the history
Check all possible txt values
  • Loading branch information
RogierW authored Aug 22, 2023
2 parents 1bd03af + 7ebbf61 commit 37b2f74
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Support/LocalChallengeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ public static function dns(string $domain, string $name, string $value): void
{
$response = @dns_get_record(sprintf('%s.%s', $name, $domain), DNS_TXT);

if (!empty($response[0]['txt']) && $response[0]['txt'] === $value) {
return;
if (!in_array($value, array_column($response, 'txt'), true)) {
throw DomainValidationException::localDnsChallengeTestFailed($domain);
}

throw DomainValidationException::localDnsChallengeTestFailed($domain);
}
}

0 comments on commit 37b2f74

Please sign in to comment.