Exemplo n.º 1
0
 /**
  * Returns true if the domain is currently in the HTTP_HOST
  * @return boolean
  */
 public function isActive()
 {
     if ($this->isAllowedPath($_SERVER['REQUEST_URI'])) {
         return false;
     }
     $current_host = $_SERVER['HTTP_HOST'];
     $allow_subdomains = MultiDomain::config()->allow_subdomains;
     $hostname = $this->getHostname();
     return $allow_subdomains ? preg_match('/(\\.|^)' . $hostname . '$/', $current_host) : $current_host == $hostname;
 }
 /**
  * Returns true if the domain is currently in the HTTP_HOST
  * @return boolean
  */
 public function isActive()
 {
     if ($this->isAllowedPath($_SERVER['REQUEST_URI'])) {
         return false;
     }
     $currentHost = $_SERVER['HTTP_HOST'];
     if (strpos(':', $currentHost) !== false) {
         list($currentHost, $currentPort) = explode(':', $currentHost, 2);
     }
     $allow_subdomains = MultiDomain::config()->allow_subdomains;
     $hostname = $this->getHostname();
     return $allow_subdomains ? preg_match('/(\\.|^)' . $hostname . '$/', $currentHost) : $currentHost == $hostname;
 }