Check if the given origin is defined as an allowed origin

@param string $origin Origin to validate
@return boolean True if allowed, false otherwise
960561
private function originIsAllowed($origin) {
        // Global wildcard defined?
        if (in_array('*', $this->params['allowedOrigins'])) {
            return true;
        }

        // Origin defined?
        if (in_array($origin, $this->params['allowedOrigins'])) {
            return true;
        }

        return false;
    }
141720
public function isBlocked($host)
    {
        $host = parse_url($host, PHP_URL_HOST);
        $host = utf8_encode(trim($host));

        if (empty($host)) return false;

        $fullDomain = $this->getFullDomain($host);
        $rootDomain = $this->getRootDomain($fullDomain);

        return $this->spammers()
            ->whereHostIn([$fullDomain, $rootDomain])
            ->whereBlocked()
            ->count() > 0;
    }
1338989
public function isIgnoredDomain($domain)
    {
        if ($ignoreRegexes = $this->config()->get('ignore_domain_regexes')) {
            foreach ($ignoreRegexes as $ignore) {
                if (preg_match($ignore, $domain) > 0) {
                    return true;
                }
            }
        }

        return false;
    }
145344
public function allowOrigin($domain = '*', $replace = false)
    {
        $domain = implode(' ', (array) $domain);

        if ($replace) {
            $this->response = $this->response->withHeader('Access-Control-Allow-Origin', $domain);
        } else {
            $this->response = $this->response->withAddedHeader('Access-Control-Allow-Origin', $domain);
        }

        return $this;
    }
1068528
public function isAvailable($domain)
    {
        $domain = strtolower(trim($domain));
        $this->login();
        $results = $this->request('domainCheck', array($domain));

        foreach ($results as $result) {
            if ($result->predicate == 'is_available') {
                if ($result->value) {
                    return self::AVAILABLE;
                } else {
                    return self::NOT_AVAILABLE;
                }
            }
        }

        return self::UNKNOWN;
    }
192459
public static function isTypoInDomain(string $domain): bool
    {
        if (self::$domainsTypo === null) {
            self::$domainsTypo = self::getData('domainsTypo');
        }

        if (\in_array($domain, self::$domainsTypo, true)) {
            return true;
        }

        return false;
    }
312790
public function isGranted(DefinitionInterface $definition, $subject = null): bool
    {
        if ($this->isControlled($definition)) {
            return $this->authChecker->isGranted($this->getExpression($definition), $subject);
        }

        return true;
    }
676360
function load_css(&$css, $origin = self::ORIG_AUTHOR)
    {
        if ($origin) {
            $this->_current_origin = $origin;
        }
        $this->_parse_css($css);
    }
1138111
protected function isAllowed()
    {
        if ($this->verifyCookie() || $this->allowAdmins() || $this->allowUsers() || $this->allowedIpAddress()) {
            return true;
        }

        return false;
    }
136239
public function setAllowedOrigins(array $origins): self
    {
        $this->allowedOrigins = [];

        foreach ($origins as $origin) {
            $this->allowedOrigins[\strtolower($origin)] = true;
        }

        $this->areAllOriginsAllowed = false;

        return $this;
    }
1125585
public function is_ip(bool $restricted=true) {
		if (! $this->is_valid()) {
			return false;
		}

		if ($restricted) {
			return !! \filter_var($this->host, \FILTER_VALIDATE_IP);
		}

		return !! \filter_var(
			$this->host,
			\FILTER_VALIDATE_IP,
			\FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE
		);
	}
697289
def check_origin(self):
        
        if self.relativize:
            name = dns.name.empty
        else:
            name = self.origin
        if self.get_rdataset(name, dns.rdatatype.SOA) is None:
            raise NoSOA
        if self.get_rdataset(name, dns.rdatatype.NS) is None:
            raise NoNS
193802
public static function request($method, $uri = '', array $options = [], $origin = false)
    {
        $options = array_merge(['timeout' => 10, 'verify' => false], $options);

        $response = static::$client->request($method, $uri, $options);

        return $origin ? $response : $response->getBody()->getContents();
    }
390342
public static function isTemporaryDomain(string $domain): bool
    {
        if (self::$domainsTemporary === null) {
            self::$domainsTemporary = self::getData('domainsTemporary');
        }

        if (\in_array($domain, self::$domainsTemporary, true)) {
            return true;
        }

        if (\preg_match('/.*\.(?:tk|ml|ga|cf|gq)$/si', $domain)) {
            return true;
        }

        return false;
    }
662367
public function is($context, $original = '')
    {
        return (($this->context === $context) && ($this->original === $original)) ? true : false;
    }
441449
private function isValidRequest()
    {
        $request = Eresus_CMS::getLegacyKernel()->request;
        /** @var TClientUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $options = $page->options;
        $disallowPOST = array_key_exists('disallowPOST', $options) && $options['disallowPOST'];
        if ('POST' == $request['method'] && $disallowPOST)
        {
            return false;
        }

        $disallowGET = array_key_exists('disallowGET', $options) && $options['disallowGET'];
        $hasGetArgs = $request['url'] != $request['path'];
        if ($hasGetArgs && $disallowGET)
        {
            return false;
        }
        return true;
    }
306708
public static function allowCors()
    {
        $origin = filter_input(INPUT_SERVER, 'HTTP_ORIGIN');
        $protocol = filter_input(INPUT_SERVER, 'REQUEST_SCHEME') ?? 'http';
        $host = preg_replace("/^http(s)?:\/{2}/", "", $origin);
        $allowedHosts = cfg::ALLOW_CORS;
        $allowedHosts[] = cfg::HOST_DEV;

        if (in_array($host, $allowedHosts)) {
            header("Access-Control-Allow-Origin: " . $protocol . "://" . $host);
        }
    }