Skip to content

Commit

Permalink
try to fix psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed Jan 24, 2024
1 parent c2bfe1d commit b4a380c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion php/domain-validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
http_response_code(400);
} elseif (strpos($domain, ':') !== false) {
http_response_code(400);
} elseif (!filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
} elseif (!filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {
http_response_code(400);
} elseif (filter_var($domain, FILTER_VALIDATE_IP)) {
http_response_code(400);
Expand Down
4 changes: 2 additions & 2 deletions php/src/Data/ConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function SetDomain(string $domain) : void {
}

// Validate domain
if (!filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
if (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {
throw new InvalidSettingConfigurationException("Domain is not a valid domain!");
}

Expand All @@ -305,7 +305,7 @@ public function SetDomain(string $domain) : void {

if (empty($dnsRecordIP)) {
$record = dns_get_record($domain, DNS_AAAA);
if (!empty($record)) {
if (!empty($record[0]['ipv6'])) {
$dnsRecordIP = $record[0]['ipv6'];
}
}
Expand Down

0 comments on commit b4a380c

Please sign in to comment.