BUGFIX Installer redirect to home/ (without domain)

This fixes a bug where the installer redirects to home/ ('home' as the domain) as the url as opposed to localhost/home.

To reproduce:
* Use chrome (untested in other browsers)
* composer create project silverstripe/installer
* Run through the installer

Expected:
* Silverstripe installs and it takes you to the success page

Actual:
* SilverStripe installs and takes you to a different domain (ie. 'http://home')

The problem seems to be, any URL starting with `//` (two slashes) is normalised by the browser to an absolute URL by removing both slashes meaning `//home` becomes just `home` (as in http://home)
This commit is contained in:
Michael Strong 2018-08-06 14:48:23 +12:00 committed by GitHub
parent 3b06385b7d
commit 13372f9a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -601,7 +601,7 @@ TEXT;
$token = new ParameterConfirmationToken('flush', new HTTPRequest('GET', '/'));
$params = http_build_query($token->params());
$destinationURL = BASE_URL . '/' . (
$destinationURL = rtrim(BASE_URL, '/') . '/' . (
$this->checkModuleExists('cms')
? "home/successfullyinstalled?$params"
: "?$params"