]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add missing urldecode and idn_to_utf8 calls to local address checker
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 20 Sep 2022 10:20:35 +0000 (12:20 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 14 Nov 2022 10:14:29 +0000 (11:14 +0100)
The call to idn_to_utf8 call is actually to apply normalization

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/Http/Client/DnsPinMiddleware.php
lib/private/Http/Client/LocalAddressChecker.php

index ee0ea053dcfe61f1b89962ec681763f8b648c5c8..f5e6214a4ab45cb66934d0632ba6cd6b9bc9a9ac 100644 (file)
@@ -125,7 +125,7 @@ class DnsPinMiddleware {
                                        $ports[] = (string)$port;
                                }
 
-                               $targetIps = $this->dnsResolve($hostName, 0);
+                               $targetIps = $this->dnsResolve(idn_to_utf8($hostName), 0);
 
                                $curlResolves = [];
 
index da641b57c0417489140b9f241ccf0beff7c6b8e8..8c86cbabf07642f93ffadeec35d4364ac8f8f3ff 100644 (file)
@@ -72,7 +72,7 @@ class LocalAddressChecker {
                        throw new LocalServerException('Could not detect any host');
                }
 
-               $host = strtolower($host);
+               $host = idn_to_utf8(strtolower(urldecode($host)));
                // Remove brackets from IPv6 addresses
                if (strpos($host, '[') === 0 && substr($host, -1) === ']') {
                        $host = substr($host, 1, -1);