Skip to content

Commit 85a2908

Browse files
committed
refactor: rename variable names
1 parent 1e15f37 commit 85a2908

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

system/Helpers/url_helper.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,19 @@ function base_url($relativePath = '', ?string $scheme = null): string
157157
function current_url(bool $returnObject = false, ?IncomingRequest $request = null)
158158
{
159159
$request ??= Services::request();
160-
$path = $request->getPath();
160+
$routePath = $request->getPath();
161+
$currentURI = $request->getUri();
161162

163+
$relativePath = $routePath;
162164
// Append queries and fragments
163-
if ($query = $request->getUri()->getQuery()) {
164-
$path .= '?' . $query;
165+
if ($query = $currentURI->getQuery()) {
166+
$relativePath .= '?' . $query;
165167
}
166-
if ($fragment = $request->getUri()->getFragment()) {
167-
$path .= '#' . $fragment;
168+
if ($fragment = $currentURI->getFragment()) {
169+
$relativePath .= '#' . $fragment;
168170
}
169171

170-
$uri = _get_uri($path);
172+
$uri = _get_uri($relativePath);
171173

172174
return $returnObject ? $uri : URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath());
173175
}

0 commit comments

Comments
 (0)