Get rewrite info. This info is read from $_GET['_url'].
This returns '/' if the rewrite information cannot be read

@return string
354145
protected function getRewriteUri()
    {
        if ($this->uriSource === self::URI_SOURCE_SERVER_REQUEST_URI) {
            if (isset($_SERVER['REQUEST_URI'])) {
                $requestUri = explode('?', $_SERVER['REQUEST_URI']);
                if (!empty($requestUri[0])) {
                    return $requestUri[0];
                }
            }
        } else {
            if (isset($_GET['_url']) && !empty($_GET['_url'])) {
                return $_GET['_url'];
            }
        }

        return '/';
    }
955963
public function getPathInfo()
    {
        $pathInfo = parent::getPathInfo();
        $pathLength = \strlen($pathInfo);

        if ($pathInfo !== '/' && $pathInfo[$pathLength - 1] === '/'
            && (bool) ConfigQuery::read('allow_slash_ended_uri', false)
        ) {
            if (null === $this->resolvedPathInfo) {
                $this->resolvedPathInfo = substr($pathInfo, 0, $pathLength - 1); // Remove the slash
            }

            $pathInfo = $this->resolvedPathInfo;
        }

        return $pathInfo;
    }
279883
public function getUrls() : string
    {
        $regex = '((https?|ftp)://)?'; // SCHEME
        $regex .= '([a-z0-9+!*(),;?&=$_.-]+(:[a-z0-9+!*(),;?&=$_.-]+)?@)?'; // User and Pass
        $regex .= '([a-z0-9\-\.]*)\.(([a-z]{2,4})|([0-9]{1,3}\.([0-9]{1,3})\.([0-9]{1,3})))'; // Host or IP
        $regex .= "(:[0-9]{2,5})?"; // Port
        $regex .= '(/([a-z0-9+$_%-]\.?)+)*/?'; // Path
        $regex .= '(\?[a-z+&\$_.-][a-z0-9;:@&%=+/$_.-]*)?'; // GET Query
        $regex .= '(#[a-z_.-][a-z0-9+$%_.-]*)?'; // Anchor
        return $regex;
    }
117939
public function getRequestUrl($url)
    {
        if ($this->getPerPage() && $this->getPage()) {
            return $url . $this->getRequestPageInfo();
        }

        return $url;
    }
182934
public static function getPathInfo()
    {
        if (isset($_SERVER['PATH_INFO']) &&
            (strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') === false)) {
            return $_SERVER['PATH_INFO'];
        } elseif (isset($_SERVER['REQUEST_URI']) &&
                  isset($_SERVER['SCRIPT_NAME'])) {
            $search = Horde_String::common($_SERVER['SCRIPT_NAME'], $_SERVER['REQUEST_URI']);
            if (substr($search, -1) == '/') {
                $search = substr($search, 0, -1);
            }
            $search = array($search);
            if (!empty($_SERVER['QUERY_STRING'])) {
                // We can't use QUERY_STRING directly because URL rewriting
                // might add more parameters to the query string than those
                // from the request URI.
                $url = parse_url($_SERVER['REQUEST_URI']);
                if (!empty($url['query'])) {
                    $search[] = '?' . $url['query'];
                }
            }
            $path = str_replace($search, '', $_SERVER['REQUEST_URI']);
            if ($path == '/') {
                $path = '';
            }
            return $path;
        }

        return '';
    }
353898
protected function get()
    {
        $url = '';
        if ($this->scheme) {
            $url = $this->scheme . ':';
        }
        if ($this->host) {
            $url .= '//' . $this->authority();
        }
        if ($this->path) {
            $url .= '/' . ltrim($this->path, '/');
        }
        if ($this->query) {
            $url .= '?' . $this->query;
        }
        if ($this->fragment) {
            $url .= '#' . $this->fragment;
        }

        return $url;
    }
763594
protected function rewrite() {
		$routes=array();
		$aliases=&$this->f3->ref('ALIASES');
		$redirects=array();
		foreach($this->f3->get('ROUTES') as $old=>$data) {
			$route=current(current($data));//let's pick up any route just to get the URL name
			$name=@$route[3];//PHP 5.3 compatibility
			$new=$old;
			if (!($name && in_array($name,$this->global_aliases)
				|| isset($this->global_regex) && preg_match($this->global_regex,$old))) {
				if (isset($this->rules[$this->current][$name])) {
					$new=$this->rules[$this->current][$name];
					if ($new===FALSE) {
						if (isset($aliases[$name]))
							unset($aliases[$name]);
						continue;
					}
				}
				$new=rtrim('/'.$this->current.($new),'/');
				if ($this->migrate && $this->auto) {
					$redir=$old;
					if (isset($this->rules[$this->primary][$name]))
						$redir=$this->rules[$this->primary][$name];
					if ($redir!==FALSE)
						$redirects[$old]=rtrim('/'.$this->primary.($redir),'/');
				}
			}
			if (isset($routes[$new]) && $this->strict)
				user_error(sprintf(self::E_Duplicate,$new),E_USER_ERROR);
			$routes[$new]=$data;
			if (isset($aliases[$name]))
				$aliases[$name]=$new;
		}
		$this->f3->set('ROUTES',$routes);
		foreach($redirects as $old=>$new)
			$this->f3->route('GET '.$old,function($f3)use($new){$f3->reroute($new,TRUE);});
	}
830719
public static function getCurrentURL()
    {
        $url = 'http://';
        if (self::isHttps()) {
            $url = 'https://';
        }

        if (isset($_SERVER['PHP_AUTH_USER'])) {
            $url .= $_SERVER['PHP_AUTH_USER'];
            if (isset($_SERVER['PHP_AUTH_PW'])) {
                $url .= ':'.$_SERVER['PHP_AUTH_PW'];
            }
            $url .= '@';
        }
        if (isset($_SERVER['HTTP_HOST'])) {
            $url .= $_SERVER['HTTP_HOST'];
        }
        if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80) {
            $url .= ':'.$_SERVER['SERVER_PORT'];
        }
        if (!isset($_SERVER['REQUEST_URI'])) {
            $url .= substr($_SERVER['PHP_SELF'], 1);
            if (isset($_SERVER['QUERY_STRING'])) {
                $url .= '?'.$_SERVER['QUERY_STRING'];
            }

            return $url;
        }

        $url .= $_SERVER['REQUEST_URI'];

        return $url;
    }
632034
public function getRequestedActionName()
    {
        if (isset($this->_routingInfo['requested_action'])) {
            return $this->_routingInfo['requested_action'];
        }
        if (($this->_rewritedPathInfo !== null) && isset($this->_rewritedPathInfo[2])) {
            return $this->_rewritedPathInfo[2];
        }
        return $this->getActionName();
    }
29207
public function getRequestUri() 
    {
        if (!$this->uri) {
            $queryString = (PHP_SAPI == 'cli' && isset($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : $this->getServer('QUERY_STRING');
            if (!$this->getServer('REQUEST_URI')) {
                $_SERVER['REQUEST_URI'] = $this->getScriptUrl() . ($queryString ? '?'  : '') . $queryString;
            } else if (strpos($this->getServer('REQUEST_URI'), '?') === false && $queryString) {
                $_SERVER['REQUEST_URI'] .= '?' . $queryString;
            }
            
            $this->uri = &$_SERVER['REQUEST_URI'];    
        }
        
        return $this->uri;
    }
732386
private function currentURL() {
        $pageURL = 'http';
        if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
            $pageURL .= "s";
        }
        $pageURL .= "://";
        if ($_SERVER["SERVER_PORT"] != "80") {
            $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
        } else {
            $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
        }
        return $pageURL;
    }
546696
def rewrite_url(self, url_info: URLInfo) -> URLInfo:
        ''''''
        if self._url_rewriter:
            return self._url_rewriter.rewrite(url_info)
        else:
            return url_info
774829
public static function getCurrentUrl()
    {
        return self::getCurrentScheme() . '://'
        . self::getCurrentHost()
        . self::getCurrentScriptName(false)
        . self::getCurrentQueryString();
    }
344031
protected function getRequestInformation() {
		$postdata = '';
			
		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
			// build a request string
			$t = array();
			
			foreach ($_POST as $k => $v) {
				$t[] = $k . '=' . $v;
			}

			// make a one line string
			$postdata = preg_replace('![\n\r]!',"",implode('&',$t));
			
			// truncate if too long
			if (strlen($postdata) > 250) {
				$postdata = substr($postdata,0,250);
			}
		}

		// build a string with information about a request
		$requestinfo = ' '.getmypid() . "; " .
			basename($_SERVER['SCRIPT_FILENAME']) . "; " .
			$_SERVER['REMOTE_ADDR'] . "; " .
			$_SERVER['REQUEST_METHOD'] . "; " .
			$_SERVER['QUERY_STRING'] . "; " .
			$postdata . "; " .
			$_SERVER['HTTP_USER_AGENT'] . "; " .
			$_SERVER['HTTP_REFERER'];
		return $requestinfo;
	}
343537
protected function prepareRequestUri()
    {
        $requestUri = '';

        if ($this->headers->has('X_REWRITE_URL') && false !== stripos(PHP_OS, 'WIN')) {
            // check this first so IIS will catch
            $requestUri = $this->headers->get('X_REWRITE_URL');
        } elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $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');
        } elseif ($this->server->has('REQUEST_URI')) {
            $requestUri = $this->server->get('REQUEST_URI');
            // HTTP proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path
            $schemeAndHttpHost = $this->getScheme().'://'.$this->getHttpHost();
            if (strpos($requestUri, $schemeAndHttpHost) === 0) {
                $requestUri = substr($requestUri, strlen($schemeAndHttpHost));
            }
        } 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');
            }
        }

        return $requestUri;
    }
252171
public static function getUrls() {
        if (static::$urls !== null)
            return static::$urls;

        $uri = $_SERVER['REQUEST_URI'];

        static::$isVirtual = true;
        if (substr($uri, 0, strlen($_SERVER['SCRIPT_NAME'])) === $_SERVER['SCRIPT_NAME']) {
            $uri = str_replace('/index.php', '', $uri);
        }
        else if (stristr($_SERVER['SCRIPT_NAME'], '/index.php', true)) {
            static::$serverPath = stristr($_SERVER['SCRIPT_NAME'], '/index.php', true);

            $uri = str_replace(array(static::$serverPath, '/index.php'), '', $uri);
            static::$isVirtual = false;
        }

        parse_str($_SERVER['QUERY_STRING'], $_GET);
        static::$urls = static::updateArrayKeys(explode('/', str_replace('?' . $_SERVER['QUERY_STRING'], '', $uri)), true);
        return static::$urls;
    }
1347902
public function get_return_url() {
        global $CFG;
        return $CFG->wwwroot . '/mod/' . $this->cm->modname . '/view.php?id=' . $this->cm->id;
    }