Filters the URI property of the given ezcMvcRequest object, removing
any version token from it.

@return void
356720
public function filterRequestUri()
    {
        if ( !empty( $this->versionToken ) )
        {
            // Remove the first occurrence of version token
            $versionSearch = '/' . $this->versionToken;
            $versionPos = strpos( $this->request->uri, $versionSearch );
            if ( $versionPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $versionPos, strlen( $versionSearch ) );
            }
        }
        if ( !empty( $this->apiProviderToken ) )
        {
            // Remove the first occurrence of API provider token
            $providerSearch = '/' . $this->apiProviderToken;
            $providerPos = strpos( $this->request->uri, $providerSearch );
            if ( $providerPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $providerPos, strlen( $providerSearch ) );
            }
        }
    }
335411
private function isUriWithSchemeAndPathOnly()
    {
        return null === $this->authority
            && null === $this->query
            && null === $this->fragment;
    }
1354230
public static function removeLeadingSlash($uri)
    {
        $uri = self::filterUri($uri);
        $path = $uri->getPath();
        if ('' !== $path && '/' === $path[0]) {
            $path = substr($path, 1);
        }

        return self::normalizePath($uri, $path);
    }
582150
public function getNormalizeUri()
    {
        if (null === $this->getSite()) {
            return $this->getUrl();
        }

        return $this->getUrl().$this->getSite()->getDefaultExtension();
    }
1364630
public function parseUri()
    {
        $uri = (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null);

        if(isset($uri))
        {
            $uri = '/' . ltrim(trim($uri), '/');
            $uri = filter_var($uri, FILTER_SANITIZE_URL);

            return $uri;
        }
        else
        {
            throw new Exception("Error parsing URI please check your URI.", 1);
        }
    }
263202
private function setRequestURI()
    {

        if (!isset($_SERVER['REQUEST_URI']) || !isset($_SERVER['SCRIPT_NAME']))
        {
            $this->request_uri = '';
        }
        else
        {

            $uri = $_SERVER['REQUEST_URI'];
            $script = $_SERVER['SCRIPT_NAME'];

            if (strpos($uri, $script) === 0)
            {
                $uri = substr($uri, strlen($script));
            }
            elseif (strpos($uri, dirname($script)) === 0)
            {
                $uri = substr($uri, strlen(dirname($script)));
            }

            if (strncmp($uri, '?/', 2) === 0)
            {
                $uri = substr($uri, 2);
            }

            $parts = preg_split('#\?#i', $uri, 2);
            $uri = $parts[0];

            if ($uri == '/' || empty($uri))
            {
                $this->request_uri = '';
            }

            $uri = parse_url($uri, PHP_URL_PATH);
            $this->request_uri = str_replace(array('//', '../'), '/', trim($uri, '/'));
        }
    }
338748
protected function detectResourcesBaseUri()
    {
        $uri = '';
        $request = $this->getHttpRequest();
        if ($request instanceof HttpRequest) {
            $uri = $request->getBaseUri();
        }
        return (string)$uri;
    }
161773
public static function setMvc($request_uri = null) {
		// storing previous mvc settings
		if (\Application::get('mvc.module')) {
			$mvc_prev = \Application::get('mvc_prev');
			if (is_array($mvc_prev)) $mvc_prev = [];
			$mvc_prev[] = \Application::get('mvc');
			\Application::set('mvc_prev', $mvc_prev);
		}
		// processing
		$request_uri = !empty($request_uri) ? $request_uri : $_SERVER['REQUEST_URI'];
		// routing based on rules
		$request_uri = self::route($request_uri);
		// parsing request
		$data = self::mvc($request_uri);
		// forming class name and file
		if (in_array('Controller', $data['controllers'])) {
			$controller_class = str_replace(' ', '\\', implode(' ', $data['controllers']));
			$file = './../libraries/private/' . str_replace('\\', DIRECTORY_SEPARATOR, $controller_class . '.php');
			if (!file_exists($file)) {
				$file = './../libraries/vendor/' . str_replace('\\', DIRECTORY_SEPARATOR, $controller_class . '.php');
			}
		} else {
			$controller_class = 'Controller\\' . str_replace(' ', '\\', implode(' ', $data['controllers']));
			$file = './' . str_replace('\\', DIRECTORY_SEPARATOR, $controller_class . '.php');
		}
		$controller_class = '\\' . $controller_class;
		// assembling everything into settings
		$data = $data;
		$data['controller_class'] = $controller_class;
		$data['controller_action'] = 'action' . str_replace('_', ' ', $data['action']);
		$data['controller_action_code'] = $data['action'];
		$data['controller_id'] = $data['id'];
		$data['controller_view'] = $data['action'];
		$data['controller_layout'] = \Application::get('application.layout.layout') ?? 'index';
		$data['controller_layout_extension'] = \Application::get('application.layout.extension') ?? 'html';
		$data['controller_layout_file'] = \Application::get(['application', 'path_full']) . 'Layout/' . $data['controller_layout'] . '.' . $data['controller_layout_extension'];
		$data['controller_file'] = $file;
		\Application::set('mvc', $data);
	}
21967
public function uri()
    {
        $filters = $this->queryFilters();

        $uri = static::BASE_URI . '/sms/admin/v1/statistics';

        return count($filters) ? $uri.'?'.http_build_query($filters) : $uri;
    }
269184
static function removeURLlinkList( $contentObjectAttributeID, $contentObjectAttributeVersion )
    {
        $conditions = array( 'contentobject_attribute_id' => $contentObjectAttributeID );
        if ( $contentObjectAttributeVersion !== false )
            $conditions['contentobject_attribute_version'] = $contentObjectAttributeVersion;
        eZPersistentObject::removeObject( eZURLObjectLink::definition(),
                                          $conditions );
    }
389978
static public function urlTranslationEnabledByUri( eZURI $uri )
    {
        if ( $uri->isEmpty() )
            return false;

        $ini = eZINI::instance();
        if ( $ini->variable( 'URLTranslator', 'Translation' ) === 'enabled' )
        {
            if ( $ini->variable( 'URLTranslator', 'TranslatableSystemUrls' ) === 'disabled' )
            {
                $moduleName = $uri->element( 0 );
                $moduleINI  = eZINI::instance( 'module.ini' );
                $moduleList = $moduleINI->variable( 'ModuleSettings', 'ModuleList' );
                if ( in_array( $moduleName, $moduleList, true ) )
                  return false;
            }
            return true;
        }
        return false;
    }
284519
protected function processUri($uri)
    {
        return preg_replace_callback('#\{([a-zA-Z0-9_,]*)\}#i', function ($matches) {
            return isset($this->tokens[$matches[1]]) ? $this->tokens[$matches[1]] : '';
        }, $uri);
    }
522941
static function cleanup( $baseURL )
    {
        $db = eZDB::instance();
        $baseURLText = $db->escapeString( $baseURL . "/*" );
        $sql = "DELETE FROM ezurlwildcard
                WHERE source_url = '$baseURLText'";
        $db->query( $sql );
        self::expireCache();
    }
888058
protected function _normalize()
    {
        /* Clients conforming to RFC 4314 MUST ignore the virtual ACL_CREATE
         * and ACL_DELETE rights. See RFC 4314 [2.1]. However, we still need
         * to handle these rights when dealing with RFC 2086 servers since
         * we are abstracting out use of ACL_CREATE/ACL_DELETE to their
         * component RFC 4314 rights. */
        foreach ($this->_virtual as $key => $val) {
            if (isset($this->_optional[$key])) {
                unset($this->_optional[$key]);
                foreach ($val as $val2) {
                    $this->_optional[$val2] = implode('', $val);
                }
            } elseif (($pos = array_search($key, $this->_required)) !== false) {
                unset($this->_required[$pos]);
                $this->_required = array_unique(array_merge($this->_required, $val));
            }
        }
    }
798505
protected function RemoveQueryString($url, Request $request)
    {
        if (isset($url) && !empty($url)) {
            $parts = explode('&', $url);

            if (strpos($parts[0], '=') === false) {
                $url = $parts[0];
            } else {
                $url = self::RemoveQueryString($request->getQueryString());
            }
        }

        return $url;
    }
344903
protected function getRequestUri()
    {

        if (!$this->requestUri) {
            $this->requestUri = rtrim($this->endpointUri, '/') . '/' . $this->version;
        }

        return $this->requestUri;

    }
594640
protected function prepareRequestUri()
    {
        $requestUri = '';

        if ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) {
            // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem)
            $requestUri = $this->server->get('UNENCODED_URL');
            $this->server->remove('UNENCODED_URL');
            $this->server->remove('IIS_WasUrlRewritten');
        } elseif ($this->server->has('REQUEST_URI')) {
            $requestUri = $this->server->get('REQUEST_URI');

            if ('' !== $requestUri && '/' === $requestUri[0]) {
                // To only use path and query remove the fragment.
                if (false !== $pos = strpos($requestUri, '#')) {
                    $requestUri = substr($requestUri, 0, $pos);
                }
            } else {
                // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path,
                // only use URL path.
                $uriComponents = parse_url($requestUri);

                if (isset($uriComponents['path'])) {
                    $requestUri = $uriComponents['path'];
                }

                if (isset($uriComponents['query'])) {
                    $requestUri .= '?'.$uriComponents['query'];
                }
            }
        } elseif ($this->server->has('ORIG_PATH_INFO')) {
            // IIS 5.0, PHP as CGI
            $requestUri = $this->server->get('ORIG_PATH_INFO');
            if ('' != $this->server->get('QUERY_STRING')) {
                $requestUri .= '?'.$this->server->get('QUERY_STRING');
            }
            $this->server->remove('ORIG_PATH_INFO');
        }

        // normalize the request URI to ease creating sub-requests from this request
        $this->server->set('REQUEST_URI', $requestUri);

        return $requestUri;
    }