Check if the sitemap contains an url.

@param string $url

@return boolean
173844
public function contains($url)
	{
		$url = trim($url, '/');

		foreach ($this->entries as $entry) {
			if ($entry['loc'] == $url) {
				return TRUE;
			}
		}

		return FALSE;
	}
392583
private function isBaseUrl($url)
    {
        if ($url === static::BASE_URL_IDENTIFIER
            || array_key_exists($url, $this->urlMappings) && $this->baseUrl === $this->urlMappings[$url]
        ) {
            return true;
        }

        return false;
    }
725533
private function urlWhitelisted($url)
    {
        $always_allowed = array('localhost');
        $whitelisted_domains = array_merge($this->options->getWhitelist(), $always_allowed);

        // Add http if missing(to satisfy parse_url())
        if (strpos($url, "/") !== 0 && strpos($url, "http") !== 0) {
            $url = 'http://' . $url;
        }
        $domain = parse_url($url, PHP_URL_HOST);

        if (strpos($url, "/") === 0 || in_array($domain, $whitelisted_domains)) {
            return true;
        }

        foreach ($whitelisted_domains as $whitelisted_domain) {
            $whitelisted_domain = '.' . $whitelisted_domain;
            if (strpos($domain, $whitelisted_domain) === (strlen($domain) - strlen($whitelisted_domain))) {
                return true;
            }
        }

        return false;
    }
1341152
public function match($url)
    {
        if (!$this->schemes) {
            return true;
        }

        foreach ($this->schemes as $scheme) {
            if ($scheme->match($url)) {
                return true;
            }
        }

        return false;
    }
581041
public function has($crawlUrl): bool
    {
        if (! $crawlUrl instanceof CrawlUrl) {
            $crawlUrl = CrawlUrl::create($crawlUrl);
        }

        if ($this->contains($this->urls, $crawlUrl)) {
            return true;
        }

        return false;
    }
1323860
protected function checkIfReservedWordInUrl($url = false)
    {
        $sections = $this->getCurrentUrlSections();
        if (count($sections) >= 1) {
            $last = intval($sections[count($sections) - 1]);
        }

        $keywords = [
            'show',
            'create',
            'edit',
        ];

        foreach ($sections as $key => $slug) {
            if (in_array($slug, $keywords)) {
                return $slug;
            }
        }

        // resource ID
        if ($last >= 1) {
            return 'show';
        }

        return false;
    }
249184
protected function _matchRelative($url) {
        $relative = $this->_relative();
        if (!$relative) {
            return true;
        }
        $components = parse_url($url);
        if (!isset($components['host'])) {
            return true;
        }
        $path = trim($components['path'], '/');
        return strpos($path, $relative) === 0;
    }
276410
private function patternMatch($url)
    {
        $url = explode('/', $url);
        $pattern = explode('/', $this->pattern);
        $matches = true;

        if (count($url) > count($pattern)) {
            return false;
        }

        foreach ($pattern as $pkey => $pvalue) {
            if (!isset($url[$pkey])) {
                if (substr($pvalue, 0, 2) === '{?') {
                    // Piece not in URL but is optional
                    continue;
                } else {
                    // Piece not in URL and is required
                    return false;
                }
            }

            if ($pvalue != $url[$pkey] && substr($pvalue, 0, 1) != '{') {
                // Doesn't contain a required part
                return false;
            }
        }

        return $matches;
    }
311896
public function hasAccess($url)
    {
        if ($this->isGuestAction($url)) {
            return true;
        }

        $path = $this->getPathFromUrl($url);

        $groupId = $this->Auth->user('group_id');

        if ($groupId === null) {
            return false;
        }

        if (!is_array($groupId)) {
            $groupId = [$groupId];
        }

        if (in_array(1, $groupId)) {
            return true;
        }

        $user = Wasabi::user();
        if (empty($user->permissions)) {
            Wasabi::user()->permissions = $this->_getGroupPermissions()->findAllForGroup($groupId);
        }

        if (array_key_exists($path, Wasabi::user()->permissions)) {
            return true;
        }

        return false;
    }
487764
public function match($url)
    {
        foreach ($this->_parsedRoutes as $value)
        {
            if (preg_match('!^' . $value['path'] . '$!', $url, $result) == 1)
            {
                $paramsWithValues = array();

                foreach ($value['params'] as $param)
                {
                    $paramsWithValues[$param] = $result[$param];
                }

                $value['params'] = $paramsWithValues;

                return $value;
            }
        }

        return false;
    }
309937
public static function isHttp(string $url)
    {
        $url = UrlHelper::validateUrl($url);

        $parsedUrl = parse_url($url);
        if ($parsedUrl === false) {
            throw new InvalidArgumentException("The provided url is not valid: $url");
        }

        return $parsedUrl["scheme"] === UrlHelper::HTTP_SCHEME;
    }
1164188
public function exists(string $url = null): bool
	{
		$urls = $this->getPageList();
		if (isset($urls[$url])) {
			return true;
		} else {
			return false;
		}
	}
1147713
public static function isRelative(string $url): bool
  {
    if ($url!=='')
    {
      return ((mb_substr($url, 0, 1)=='/' &&
          (mb_strlen($url)==1 || (mb_substr($url, 1, 1)!='/' && mb_substr($url, 1, 1)!='\\'))) ||
        (mb_strlen($url)>1 && mb_substr($url, 0, 2)=='~/'));
    }

    return false;
  }
298226
public function checkLink($url)
    {
        $url = trim($url);
        if (substr($url, 0, 7 ) == "http://") return $url;

        if (substr($url, 0, 8 ) == "https://") return $url;

        return "http://".$url;
    }
231645
public static function isLocalUrl($url)
    {
        if (empty($url)) {
            return true;
        }

        // handle host name mangling
        $requestUri = isset($_SERVER['SCRIPT_URI']) ? $_SERVER['SCRIPT_URI'] : '';
        $parseRequest = @parse_url($requestUri);
        $hosts = array(self::getHost(), self::getCurrentHost());
        if (!empty($parseRequest['host'])) {
            $hosts[] = $parseRequest['host'];
        }

        // drop port numbers from hostnames and IP addresses
        $hosts = array_map(array('self', 'getHostSanitized'), $hosts);

        $disableHostCheck = Config::getInstance()->General['enable_trusted_host_check'] == 0;
        // compare scheme and host
        $parsedUrl = @parse_url($url);
        $host = IPUtils::sanitizeIp(@$parsedUrl['host']);
        return !empty($host)
        && ($disableHostCheck || in_array($host, $hosts))
        && !empty($parsedUrl['scheme'])
        && in_array($parsedUrl['scheme'], array('http', 'https'));
    }
1263443
private function matchUrl($url)
    {
        $request = Request::create($url);
        $this->requestAnalyzer->analyze($request);

        try {
            return null !== $this->router->matchRequest($request);
        } catch (ResourceNotFoundException $exception) {
            return false;
        }
    }
129470
public static function map($url)
    {
        return (isset(self::$mapping[$url])) ? self::$mapping[$url] : false;
    }