/** * Add trusted hosts */ protected function addTrustedHosts() { $trustedHosts = array(); // extract host from the request header if (($host = $this->extractHost('http://' . Piwik_Url::getHost())) !== false) { $trustedHosts[] = $host; } // extract host from first web site if (($host = $this->extractHost(urldecode($this->session->site_url))) !== false) { $trustedHosts[] = $host; } $trustedHosts = array_unique($trustedHosts); if (count($trustedHosts)) { $this->session->general_infos['trusted_hosts'] = $trustedHosts; } }