Skip to content

Commit f3f216c

Browse files
committed
refactor: use site_url() instead of _get_uri()
1 parent e29c197 commit f3f216c

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

system/Helpers/url_helper.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,14 @@ function site_url($relativePath = '', ?string $scheme = null, ?App $config = nul
140140
*/
141141
function base_url($relativePath = '', ?string $scheme = null): string
142142
{
143-
$uri = _get_uri($relativePath);
143+
/** @var App $config */
144+
$config = clone config('App');
144145

145-
return URI::createURIString(
146-
$scheme ?? $uri->getScheme(),
147-
$uri->getAuthority(),
148-
$uri->getPath(),
149-
$uri->getQuery(),
150-
$uri->getFragment()
151-
);
146+
// Use the current baseURL for multiple domain support
147+
$config->baseURL = Services::request()->getUri()->getBaseURL();
148+
$config->indexPage = '';
149+
150+
return site_url($relativePath, $scheme, $config);
152151
}
153152
}
154153

0 commit comments

Comments
 (0)