Skip to content

Commit 3202415

Browse files
committed
refactor: rename variable names
1 parent 60fc61b commit 3202415

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

system/Helpers/url_helper.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function current_url(bool $returnObject = false, ?IncomingRequest $request = nul
160160
$routePath = $request->getPath();
161161
$currentURI = $request->getUri();
162162

163-
$url = $request->getUri()->getBaseURL();
163+
$currentBaseURL = $currentURI->getBaseURL();
164164

165165
$config = config('App');
166166
$relativePath = $routePath;
@@ -174,16 +174,17 @@ function current_url(bool $returnObject = false, ?IncomingRequest $request = nul
174174
}
175175

176176
// Check for an index page
177+
$indexPage = '';
177178
if ($config->indexPage !== '') {
178-
$url .= $config->indexPage;
179+
$indexPage = $config->indexPage;
179180

180181
// Check if we need a separator
181182
if ($relativePath !== '' && $relativePath[0] !== '/' && $relativePath[0] !== '?') {
182-
$url .= '/';
183+
$indexPage .= '/';
183184
}
184185
}
185186

186-
$uri = new URI($url . $relativePath);
187+
$uri = new URI($currentBaseURL . $indexPage . $relativePath);
187188

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

0 commit comments

Comments
 (0)