This repository was archived by the owner on Nov 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class Extract
5555 * @see https://tools.ietf.org/html/rfc1034
5656 * @see https://tools.ietf.org/html/rfc2181
5757 */
58- const HOSTNAME_PATTERN = '#^((?!-)[a-z0-9_-]{0,62}[a-z0-9 ]\.)+[a-z]{2,63}|[xn\-\-a-z0-9]]{6,63}$# ' ;
58+ const HOSTNAME_PATTERN = '#^((?!-)[a-z0-9_-]{0,62}[a-z0-9_ ]\.)+[a-z]{2,63}|[xn\-\-a-z0-9]]{6,63}$# ' ;
5959
6060 /**
6161 * @var int Value of extraction options.
Original file line number Diff line number Diff line change @@ -527,9 +527,19 @@ public function testParseUnderscore()
527527 static ::assertEquals ('com ' , $ this ->extract ->parse ('dkim._domainkey.example.com ' )->getSuffix ());
528528 static ::assertEquals ('example ' , $ this ->extract ->parse ('dkim._domainkey.example.com ' )->getHostname ());
529529 static ::assertEquals ('dkim._domainkey ' , $ this ->extract ->parse ('dkim._domainkey.example.com ' )->getSubdomain ());
530+ static ::assertEquals (array ('dkim ' ,'_domainkey ' ), $ this ->extract ->parse ('dkim._domainkey.example.com ' )->getSubdomains ());
530531
531532 static ::assertEquals ('com ' , $ this ->extract ->parse ('_spf.example.com ' )->getSuffix ());
532533 static ::assertEquals ('example ' , $ this ->extract ->parse ('_spf.example.com ' )->getHostname ());
533534 static ::assertEquals ('_spf ' , $ this ->extract ->parse ('_spf.example.com ' )->getSubdomain ());
535+
536+ static ::assertEquals ('com ' , $ this ->extract ->parse ('foo_.example.com ' )->getSuffix ());
537+ static ::assertEquals ('example ' , $ this ->extract ->parse ('foo_.example.com ' )->getHostname ());
538+ static ::assertEquals ('foo_ ' , $ this ->extract ->parse ('foo_.example.com ' )->getSubdomain ());
539+
540+ static ::assertEquals ('com ' , $ this ->extract ->parse ('bar.foo_.example.com ' )->getSuffix ());
541+ static ::assertEquals ('example ' , $ this ->extract ->parse ('bar.foo_.example.com ' )->getHostname ());
542+ static ::assertEquals ('bar.foo_ ' , $ this ->extract ->parse ('bar.foo_.example.com ' )->getSubdomain ());
543+ static ::assertEquals (array ('bar ' , 'foo_ ' ), $ this ->extract ->parse ('bar.foo_.example.com ' )->getSubdomains ());
534544 }
535545}
You can’t perform that action at this time.
0 commit comments