Skip to content

Commit fbf5a98

Browse files
author
Rafael Grigorian
committed
Fixed #143
1 parent 78ac935 commit fbf5a98

File tree

1 file changed

+2
-2
lines changed
  • src/app/code/community/JetRails/Cloudflare/Helper

1 file changed

+2
-2
lines changed

src/app/code/community/JetRails/Cloudflare/Helper/Data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)