Skip to content

Commit

Permalink
Allow optional character = in domain syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Mireya Andres committed Oct 12, 2016
1 parent 1b321ec commit 00403fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Phois/Whois/Whois.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function __construct($domain)
$this->domain = $domain;
// check $domain syntax and split full domain name on subdomain and TLDs
if (
preg_match('/^([\p{L}\d\-]+)\.((?:[\p{L}\-]+\.?)+)$/ui', $this->domain, $matches)
|| preg_match('/^(xn\-\-[\p{L}\d\-]+)\.(xn\-\-(?:[a-z\d-]+\.?1?)+)$/ui', $this->domain, $matches)
preg_match('/^(=?[\p{L}\d\-]+)\.((?:[\p{L}\-]+\.?)+)$/ui', $this->domain, $matches)
|| preg_match('/^(=?xn\-\-[\p{L}\d\-]+)\.(xn\-\-(?:[a-z\d-]+\.?1?)+)$/ui', $this->domain, $matches)
) {
$this->subDomain = $matches[1];
$this->TLDs = $matches[2];
Expand Down Expand Up @@ -189,7 +189,7 @@ public function isValid()
) {
$tmp_domain = strtolower($this->subDomain);
if (
preg_match("/^[a-z0-9\-]{3,}$/", $tmp_domain)
preg_match("/^=?[a-z0-9\-]{3,}$/", $tmp_domain)
&& !preg_match("/^-|-$/", $tmp_domain) //&& !preg_match("/--/", $tmp_domain)
) {
return true;
Expand Down

0 comments on commit 00403fb

Please sign in to comment.