Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 6e43a59

Browse files
committed
Make only ASCII TLDs uppercase
1 parent 86e023c commit 6e43a59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Hostname.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,13 +1772,15 @@ public function isValid($value)
17721772
// id-prefix: alpha / digit
17731773
// ldh: alpha / digit / dash
17741774

1775-
$this->tld = strtoupper($matches[1]);
1775+
$this->tld = $matches[1];
17761776
// Decode Punycode TLD to IDN
17771777
if (strpos($this->tld, 'xn--') === 0) {
17781778
$this->tld = $this->decodePunycode(substr($this->tld, 4));
17791779
if ($this->tld === false) {
17801780
return false;
17811781
}
1782+
} else {
1783+
$this->tld = strtoupper($this->tld);
17821784
}
17831785

17841786
// Match TLD against known list

0 commit comments

Comments
 (0)