diff --git a/include/class.organization.php b/include/class.organization.php index 3342289557c1077eeabebe7dc86e21c9f9a4d679..e1e3f44350bad64c26dcde031da2a1a2844b3eb8 100644 --- a/include/class.organization.php +++ b/include/class.organization.php @@ -159,7 +159,14 @@ class Organization extends OrganizationModel { function isMappedToDomain($domain) { foreach (explode(',', $this->domain) as $d) { - if (strcasecmp($domain, trim($d)) === 0) { + $d = trim($d); + if ($d[0] == '.') { + // Subdomain syntax (.osticket.com accepts all subdomains of + // osticket.com) + if (strcasecmp(mb_substr($domain, -mb_strlen($d)), $d) === 0) + return true; + } + elseif (strcasecmp($domain, $d) === 0) { return true; } }