Compares current URL to supplied string.

@param string $sUrl

@return bool true if $sUrl is equal to current page URL.
422095
public function isCurrentShopHost($sUrl)
    {
        $blCurrent = false;
        $sUrlHost = @parse_url($sUrl, PHP_URL_HOST);
        // checks if it is relative url.
        if (is_null($sUrlHost)) {
            $blCurrent = true;
        } else {
            $aHosts = $this->_getHosts();

            foreach ($aHosts as $sHost) {
                if ($sHost === $sUrlHost) {
                    $blCurrent = true;
                    break;
                }
            }
        }

        return $blCurrent;
    }
377006
public function isSidNeeded($sUrl = null)
    {
        if ($this->isAdmin()) {
            return true;
        }

        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if (!$this->_getSessionUseCookies() || ($sUrl && $this->_getCookieSid() && !$oConfig->isCurrentProtocol($sUrl))) {
            // switching from ssl to non ssl or vice versa?
            return true;
        }

        if ($sUrl && !$oConfig->isCurrentUrl($sUrl)) {
            return true;
        } elseif ($this->_blSidNeeded === null) {
            // setting initial state
            $this->_blSidNeeded = false;

            // no SIDs for search engines
            if (!\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
                // cookie found - SID is not needed
                if (\OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie($this->getName())) {
                    $this->_blSidNeeded = false;
                } elseif ($this->_forceSessionStart()) {
                    $this->_blSidNeeded = true;
                } else {
                    // no cookie, so must check session
                    if ($blSidNeeded = $this->getVariable('blSidNeeded')) {
                        $this->_blSidNeeded = true;
                    } elseif ($this->_isSessionRequiredAction() && !count($_COOKIE)) {
                        $this->_blSidNeeded = true;

                        // storing to session, performance..
                        $this->setVariable('blSidNeeded', $this->_blSidNeeded);
                    }
                }
            }
        }

        return $this->_blSidNeeded;
    }
570255
public function open($sUrl)
    {
        try {
            $this->getMinkSession()->visit($sUrl);
        } catch (\Selenium\Exception $exception) {
            sleep(1);
            $this->getMinkSession()->visit($sUrl);
        }
    }
758769
public function hostExists($url)
    {
        if (strpos($url, '/') === false) {
            $server = $url;
        } else {
            $server = @parse_url($url, PHP_URL_HOST);
        }
        if (!$server) {
            return false;
        }
        $ips = gethostbynamel($server);

        return !empty($ips);
    }
89846
protected function _cleanupUrl($sUrl)
    {
        // replacing &amp; to & or removing double &&
        while ((stripos($sUrl, '&amp;') !== false) || (stripos($sUrl, '&&') !== false)) {
            $sUrl = str_replace('&amp;', '&', $sUrl);
            $sUrl = str_replace('&&', '&', $sUrl);
        }

        // converting & to &amp;
        return str_replace('&', '&amp;', $sUrl);
    }
930741
public function addShopHost($sUrl)
    {
        if (!preg_match("#^https?://#i", $sUrl)) {
            $sShopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getSslShopUrl();
            $sUrl = $sShopUrl . $sUrl;
        }

        return $sUrl;
    }
673296
public static function runCurl($sUrl, $bDownload = false)
        {
            $oCurl = curl_init($sUrl);

            curl_setopt_array($oCurl, array(
                CURLOPT_BINARYTRANSFER => ($bDownload ? true : false),
                CURLOPT_CONNECTTIMEOUT => self::IMDB_TIMEOUT,
                CURLOPT_ENCODING       => '',
                CURLOPT_FOLLOWLOCATION => false,
                CURLOPT_FRESH_CONNECT  => true,
                CURLOPT_HEADER         => ($bDownload ? false : true),
                CURLOPT_HTTPHEADER     => array(
                    'Accept-Language:' . self::IMDB_LANG,
                    'Accept-Charset:' . 'utf-8, iso-8859-1;q=0.8',
                ),
                CURLOPT_REFERER        => 'http://www.google.com',
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_TIMEOUT        => self::IMDB_TIMEOUT,
                CURLOPT_USERAGENT      => 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
                CURLOPT_VERBOSE        => false
            ));

            $sOutput   = curl_exec($oCurl);
            $aCurlInfo = curl_getinfo($oCurl);

            curl_close($oCurl);

            $aCurlInfo['contents'] = $sOutput;

            if (200 !== $aCurlInfo['http_code'] && 302 !== $aCurlInfo['http_code']) {
                if (true === self::IMDB_DEBUG) {
                    echo '<pre><b>cURL returned wrong HTTP code “' . $aCurlInfo['http_code'] . '”, aborting.</b></pre>';
                }

                return false;
            }

            return $aCurlInfo;
        }
365657
public function equals($other) {
		if ($other instanceof UrlQuery) {
			return ($this->isEmpty() && $other->isEmpty()) || ($this->__toString() === $other->__toString() );
		}
		if (is_null($other)) {
			return $this->isEmpty();
		}
		return false;
	}
299492
public static function isUrl($url, bool $schemeRequired = true) {
		try {
			$url = Url::create($url)->toIdnaAsciiString();
		} catch (\InvalidArgumentException $e) {
			return false;
		}
		
		if ($schemeRequired) {
			if (false !== filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
				return true;
			}
		} else {
			if (false !== filter_var($url, FILTER_VALIDATE_URL)) {
				return true;
			}
		}
		
		return false;
	}
352978
@Nullable
  public static String getUnifiedURL (@Nullable final String sURL)
  {
    return sURL == null ? null : sURL.trim ().toLowerCase (Locale.US);
  }
1088690
public function isWebpage($url) {
		$url = filter_var($url, FILTER_VALIDATE_URL);
		if (!strlen($url)) {
			return false;
		}
		
		$c = curl_init(); 
		curl_setopt($c, CURLOPT_URL, $url); 
		curl_setopt($c, CURLOPT_HEADER, 1); // get the header 
		curl_setopt($c, CURLOPT_NOBODY, 1); // and *only* get the header 
		curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); // get the response as a string from curl_exec(), rather than echoing it 
		curl_setopt($c, CURLOPT_FRESH_CONNECT, 1); // don't use a cached version of the url 
		$result = curl_exec($c);
		
		if (!$result) { 
			return false; 
		} 
		
		if (stripos($result, 'Content-type: text/html')) {
//			$svc = new RestfulService($url);
//			$response = $svc->request('', 'GET');
			return true;
		}
		
		return false;
	}
605773
function compareUrlRoute(currentURL, currentRoute) {
                var regex = /\{(.*)\}/i;
                var arraySize = currentRoute.length,
                    testValue = false;
                for (var i = 0; i < arraySize; i++) {
                    var dynamic = regex.exec(currentRoute[i]);
                    if (dynamic) {
                        document.routeParams[dynamic[1]] = currentURL[i];
                    } else {
                        if (currentRoute[i] === currentURL[i]) {
                            testValue = true;
                        }
                    }
                }

                return testValue;
            }
1001873
public static function Redirect($sUrl){
            $oThis = self::CreateInstanceIfNotExists();

            @header($oThis->aHTTPStatus[301]);
            @header("Location: ".$sUrl);
            die();
        }
72141
public function getUrl()
    {
        if ($this->getMethod() == "GET" && $this->getQuery()) {
            $this->_sUrl = $this->_sUrl . "?" . $this->getQuery();
        }

        return $this->_sUrl;
    }
407392
protected function urlMakeSecure($sUrl, $bIsProcessing = true)
    {
        if (Functions::isPageSecure()) {
            if ($bIsProcessing) {
                $sSearch  = $this->getUri('process');
                $sReplace = $this->getUri('process_secure');
            } else {
                $sSearch  = $this->getUri('serve');
                $sReplace = $this->getUri('serve_secure');
            }
            $sUrl = str_replace($sSearch, $sReplace, $sUrl);
        }

        return preg_match('#^https?://#', $sUrl) ? $sUrl : site_url($sUrl);
    }
139241
public function callbackValidVideoUrl($sUrl)
    {
        $sId = $this->blog_post_model->extractYoutubeId($sUrl);

        if (!empty($sId)) {

            return true;

        } else {

            $sId = $this->blog_post_model->extractVimeoId($sUrl);

            if (!empty($sId)) {

                return true;

            } else {

                $oFormValidation = Factory::service('FormValidation');
                $oFormValidation->set_message('_callbackValidVideoUrl', 'Not a valid YouTube or Vimeo URL.');
                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;
    }