File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public function getDomainName () {
7878 }
7979 $ domain = Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB );
8080 $ domain = parse_url ( $ domain ) ["host " ];
81- preg_match ( "/\.? ([^.]+\ .[^.]+) $/im " , $ domain , $ matches );
81+ preg_match ( "/([^.\s]+\. ([^.\s]{3,}|[^.\s]{2}\ .[^.\s]{2}|[^.\s]{2}))\b $/im " , $ domain , $ matches );
8282 return $ matches [ 1 ];
8383 }
8484
@@ -98,7 +98,7 @@ public function getDomainNames () {
9898 $ stores = $ group ->getStores ();
9999 foreach ( $ stores as $ store ) {
100100 $ domain = parse_url ( $ store ->getBaseUrl () ) ["host " ];
101- preg_match ( "/\.? ([^.]+\ .[^.]+) $/im " , $ domain , $ matches );
101+ preg_match ( "/([^.\s]+\. ([^.\s]{3,}|[^.\s]{2}\ .[^.\s]{2}|[^.\s]{2}))\b $/im " , $ domain , $ matches );
102102 $ domain = $ matches [ 1 ];
103103 array_push ( $ domains , $ domain );
104104 }
You can’t perform that action at this time.
0 commit comments