1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Fixed double path slash URL issue in some cases

- Occurred on system request path usage (Primarily on guest login
  redirection) when a custom path was not in use.
- Added test to cover.

For #3404
This commit is contained in:
Dan Brown
2022-05-04 20:08:22 +01:00
parent 16222de5fa
commit ebc69a8f2c
2 changed files with 17 additions and 1 deletions

View File

@ -35,7 +35,8 @@ class Request extends LaravelRequest
$appUrl = config('app.url', null);
if ($appUrl) {
return '/' . rtrim(implode('/', array_slice(explode('/', $appUrl), 3)), '/');
$parsedBaseUrl = rtrim(implode('/', array_slice(explode('/', $appUrl), 3)), '/');
return empty($parsedBaseUrl) ? '' : ('/' . $parsedBaseUrl);
}
return parent::getBaseUrl();