Jetpack_Protect_Module::get_local_host PHP Method

get_local_host() public method

public get_local_host ( )
    function get_local_host()
    {
        if (isset($this->local_host)) {
            return $this->local_host;
        }
        $uri = 'http://' . strtolower($_SERVER['HTTP_HOST']);
        if (is_multisite()) {
            $uri = network_home_url();
        }
        $uridata = parse_url($uri);
        $domain = $uridata['host'];
        // If we still don't have the site_url, get it
        if (!$domain) {
            $uri = get_site_url(1);
            $uridata = parse_url($uri);
            $domain = $uridata['host'];
        }
        $this->local_host = $domain;
        return $this->local_host;
    }