Skip to content

Commit 1cac8ab

Browse files
committed
fix: logic to get current baseURL
1 parent a4b5319 commit 1cac8ab

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

system/Helpers/url_helper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ function base_url($relativePath = '', ?string $scheme = null): string
131131
$config = clone config('App');
132132

133133
// Use the current baseURL for multiple domain support
134-
$config->baseURL = Services::request()->getUri()->getBaseURL();
134+
$request = Services::request();
135+
$config->baseURL = $request instanceof CLIRequest
136+
? rtrim($config->baseURL, '/ ') . '/'
137+
: $request->getUri()->getBaseURL();
138+
135139
$config->indexPage = '';
136140

137141
return site_url($relativePath, $scheme, $config);

0 commit comments

Comments
 (0)