From c2bfe1d37de8d7792fbcc432014ccc4429606ee9 Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Sat, 20 Jan 2024 21:57:51 +0000 Subject: [PATCH 1/2] Update psalm baseline Signed-off-by: GitHub --- php/psalm-baseline.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/psalm-baseline.xml b/php/psalm-baseline.xml index efff05605ce..19d94ff7c22 100644 --- a/php/psalm-baseline.xml +++ b/php/psalm-baseline.xml @@ -1,2 +1,2 @@ - + From b4a380c1b2428e96bec23c7a437cd441966e3e1f Mon Sep 17 00:00:00 2001 From: Simon L Date: Wed, 24 Jan 2024 12:14:08 +0100 Subject: [PATCH 2/2] try to fix psalm Signed-off-by: Simon L --- php/domain-validator.php | 2 +- php/src/Data/ConfigurationManager.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php/domain-validator.php b/php/domain-validator.php index a1e6487be6c..8f4fca11dd9 100644 --- a/php/domain-validator.php +++ b/php/domain-validator.php @@ -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); diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 51780b35be2..3b3cba5db21 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -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!"); } @@ -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']; } }