Amp\Artax\Cookie\ArrayCookieJar::matchesDomain PHP Method

matchesDomain() private method

private matchesDomain ( $requestDomain, $cookieDomain )
    private function matchesDomain($requestDomain, $cookieDomain)
    {
        if ($requestDomain === $cookieDomain) {
            return $isMatch = true;
        }
        if (!($isWildcardCookieDomain = $cookieDomain[0] === '.')) {
            $isMatch = false;
        } elseif (filter_var($requestDomain, FILTER_VALIDATE_IP)) {
            $isMatch = false;
        } elseif (substr($requestDomain, 0, -\strlen($cookieDomain)) . $cookieDomain === $requestDomain) {
            $isMatch = true;
        } elseif (strrpos($cookieDomain, $requestDomain) !== false) {
            $isMatch = true;
        } else {
            $isMatch = false;
        }
        return $isMatch;
    }