function current_url(bool
$returnObject = false, ?IncomingRequest
$request = null
) { $request ??= Services::
request();
/** @var CLIRequest|IncomingRequest $request */
$uri =
$request->
getUri();
return $returnObject ?
$uri : URI::
createURIString($uri->
getScheme(),
$uri->
getAuthority(),
$uri->
getPath());
}}if (!
function_exists('previous_url'
)) { /**
* Returns the previous URL the current visitor was on. For security reasons
* we first check in a saved session variable, if it exists, and use that.
* If that's not available, however, we'll use a sanitized url from $_SERVER['HTTP_REFERER']
* which can be set by the user so is untrusted and not set by certain browsers/servers.
*
* @return string|URI
*/