Determines that the provided url is member of a url whitelist.

@param string $uri

@return bool True if the specified url is whitelisted, false otherwise.
330639
protected function isWhitelisted($uri)
    {
        $whiteList = static::$configuration->getWhiteList();

        if (empty($whiteList)) {
            return true;
        }

        $uri = $this->normalizePath($uri);

        foreach ($whiteList as $path) {
            if (strpos($uri, $path) !== false) {
                return true;
            }
        }

        return false;
    }
857499
public static boolean isAbsoluteURI( String uri )
    {
         //
         // This method needs to be fast, so it can't use java.net.URI.
         //
         if ( uri.length() == 0 || uri.charAt( 0 ) == '/' ) return false;
        
         for ( int i = 0, len = uri.length(); i < len; ++i )
         {
             char c = uri.charAt( i );
            
             if ( c == ':' )
             {
                 return true;
             }
             else if ( c == '/' )
             {
                 return false;
             }
         }
        
         return false;
     }
1352147
public function checkUri($uris)
    {
        if (!$this->request) {
            return false;
        }

        foreach ((array)$uris as $uri) {
            if ($this->uri == $uri) {
                return true;
            }
        }

        return false;
    }
256276
def is_uri_to_be_filtered(uri, filter_list):
    """"""
    match = False
    if filter_list:
        for uri_filter in filter_list:
            if re.search(uri_filter, uri, flags=re.IGNORECASE):
                match = True
        return match
755662
public static function isUri($value): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        // http://tools.ietf.org/html/rfc3986
        //
        // URI         = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
        // hier-part   = "//" authority path-abempty
        //             / path-absolute
        //             / path-rootless
        //             / path-empty
        $pattern = sprintf(
            '/\A%s%s%s%s%s\z/',
            '(?:([^:\/?#]+)(:))?',
            '(?:(\/\/)([^\/?#]*))?',
            '([^?#]*)',
            '(?:(\?)([^#]*))?',
            '(?:(#)(.*))?'
        );

        preg_match($pattern, (string) $value, $matches);
        $uri = self::uriComponentsFromMatches($matches);

        return self::isValidUri($uri);
    }
1217641
public function isStream($uri)
    {
        try {
            list ($scheme,) = $this->normalize($uri, true, true);
        } catch (\Exception $e) {
            return false;
        }

        return $this->schemeExists($scheme);
    }
1297940
public function &findPageByUri($uri)
    {
        foreach ($this->getRootSection()->getSections() as $section) {
            if ($page = $section->findPageByUri($uri)) {
                return $page;
            }
        }

        return;
    }
542527
private static function obfuscateUri($uri)
    {
        $userInfo = $uri->getUserInfo();

        if (false !== ($pos = strpos($userInfo, ':'))) {
            return $uri->withUserInfo(substr($userInfo, 0, $pos), '***');
        }

        return $uri;
    }
714568
protected static boolean isAPIUri(Uri uri) {
        if (uri == null) {
            return false;
        }

        return getBaseUri().getHost().equals(uri.getHost());
    }
587982
public static function hasExtension(string $uri, string $extension): bool
    {
        $extension       = '.' . ltrim($extension, '.');
        $uriLength       = mb_strlen($uri);
        $extensionLength = mb_strlen($extension);
        if ($extensionLength > $uriLength) {
            return false;
        }

        return substr_compare($uri, $extension, $uriLength - $extensionLength, $extensionLength) === 0;
    }
402318
public function isWhitelisted(AddressInterface $ip = null)
    {
        if ($ip === null) {
            $ip = $this->getRequestIPAddress();
        }
        $rangeType = $this->getRangeType($ip);

        return $rangeType !== null && ($rangeType & static::IPRANGEFLAG_WHITELIST) === static::IPRANGEFLAG_WHITELIST;
    }
712912
private function checkOverride($uri)
    {
        // 1st priority: /robots.txt is permanent allowed
        if (parse_url($uri, PHP_URL_PATH) === self::PATH) {
            return self::DIRECTIVE_ALLOW;
        }
        // 2st priority: Status code rules
        $statusCodeParser = new StatusCodeParser($this->statusCode, parse_url($this->base, PHP_URL_SCHEME));
        if (($result = $statusCodeParser->accessOverride()) !== false) {
            return $result;
        }
        // 3rd priority: Visit times
        if ($this->handler->visitTime->client()->isVisitTime() === false) {
            return self::DIRECTIVE_DISALLOW;
        }
        return false;
    }
903606
public function isInternal($url)
    {
        // Check if post exist by url (only works with 'public' posts)
        $postId = url_to_postid($url);
        if ($postId > 0) {
            return true;
        }

        // Check if the URL is internal or external
        $siteUrlComponents = parse_url(get_site_url());
        $urlComponents = parse_url($url);
        if (!empty($siteUrlComponents['host']) && !empty($urlComponents['host']) && strcasecmp($urlComponents['host'], $siteUrlComponents['host']) === 0) {
            // Test with get_page_by_path() to get other post statuses
            $postTypes = get_post_types(array('public' => true));
            if (!empty($urlComponents['path']) && !empty(get_page_by_path(basename(untrailingslashit($urlComponents['path'])), ARRAY_A, $postTypes))) {
                return true;
            }
        }

        return false;
    }
204042
public static function check($uri)
    {
        try {
            $uri = self::factory($uri);
        } catch (Exception $e) {
            return false;
        }

        return $uri->valid();
    }
478420
public static function isValidAsCookieDomain($uri)
    {
        $domain = self::getDomain($uri);
        if (!empty($domain)) {
            if (preg_match("/^[a-z0-9\-]+(?:[a-z0-9\-]\.)+/iu", $domain) > 0) {
                $returnValue = true;
            } else {
                $returnValue = false;
            }
        } else {
            $returnValue = false;
        }

        return $returnValue;
    }
945573
public function matches(CalledUri $calledUri): bool
    {
        if (!$this->matchesPath($calledUri)) {
            return false;
        }

        if (in_array($calledUri->method(), $this->allowedRequestMethods)) {
            return true;
        }

        if (in_array(Http::GET, $this->allowedRequestMethods)) {
            return $calledUri->methodEquals(Http::HEAD);
        }

        return false;
    }
1054576
public function checkIfExists($resourceUri) {
        //Break up the uri on the slashes
        $nodes = preg_split('/(\\\|\\/)/', $resourceUri, -1, PREG_SPLIT_NO_EMPTY);

        //foreach node
        $ptr = &$this->config;
        foreach($nodes as $node) {
            if (!isset($ptr[$node])) {
                return false;
            }
        }

        return true;
    }