Pass default values to idn_to_utf8 to fix behavior under PHP 7.3

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2022-11-15 12:11:09 +01:00
parent 8360bb8620
commit 6bdb5d2804
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
2 changed files with 2 additions and 2 deletions

View file

@ -125,7 +125,7 @@ class DnsPinMiddleware {
$ports[] = (string)$port;
}
$targetIps = $this->dnsResolve(idn_to_utf8($hostName), 0);
$targetIps = $this->dnsResolve(idn_to_utf8($hostName, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46), 0);
$curlResolves = [];

View file

@ -78,7 +78,7 @@ class LocalAddressChecker {
throw new LocalServerException('Could not detect any host');
}
$host = idn_to_utf8(strtolower(urldecode($host)));
$host = idn_to_utf8(strtolower(urldecode($host)), IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46);
// Remove brackets from IPv6 addresses
if (strpos($host, '[') === 0 && substr($host, -1) === ']') {
$host = substr($host, 1, -1);