Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pass default values to idn_to_utf8 to fix behavior under PHP 7.3
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Nov 15, 2022
commit 6bdb5d28042f8b142416f2abb3ae663a4755e5be
2 changes: 1 addition & 1 deletion lib/private/Http/Client/DnsPinMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function addDnsPinning() {
$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 = [];

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Http/Client/LocalAddressChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function ThrowIfLocalAddress(string $uri) : void {
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);
Expand Down