From: ArthurHoaro Date: Fri, 24 Jul 2020 08:30:47 +0000 (+0200) Subject: Fix default link and redirection in install controller X-Git-Tag: v0.12.0-beta~4^2~12 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=87ae3c4f08431e02869376cb57add257747910d1;hp=8e9169cebaf5697344cb373d69fe429e8e0efd5d;p=github%2Fshaarli%2FShaarli.git Fix default link and redirection in install controller --- diff --git a/application/front/controller/visitor/InstallController.php b/application/front/controller/visitor/InstallController.php index 94ebb4ae..5e3152c7 100644 --- a/application/front/controller/visitor/InstallController.php +++ b/application/front/controller/visitor/InstallController.php @@ -128,7 +128,7 @@ class InstallController extends ShaarliVisitorController $this->container->conf->get('credentials.salt') ) ); - $this->container->conf->set('general.header_link', $this->container->basePath); + $this->container->conf->set('general.header_link', $this->container->basePath . '/'); try { // Everything is ok, let's create config file. @@ -149,7 +149,7 @@ class InstallController extends ShaarliVisitorController [t('Shaarli is now configured. Please login and start shaaring your bookmarks!')] ); - return $this->redirect($response, '/'); + return $this->redirect($response, '/login'); } protected function checkPermissions(): bool diff --git a/tests/front/controller/visitor/InstallControllerTest.php b/tests/front/controller/visitor/InstallControllerTest.php index 29c4d7a0..089c64ac 100644 --- a/tests/front/controller/visitor/InstallControllerTest.php +++ b/tests/front/controller/visitor/InstallControllerTest.php @@ -236,7 +236,7 @@ class InstallControllerTest extends TestCase $result = $this->controller->save($request, $response); static::assertSame(302, $result->getStatusCode()); - static::assertSame('/subfolder/', $result->getHeader('location')[0]); + static::assertSame('/subfolder/login', $result->getHeader('location')[0]); } /** @@ -257,7 +257,7 @@ class InstallControllerTest extends TestCase $result = $this->controller->save($request, $response); static::assertSame(302, $result->getStatusCode()); - static::assertSame('/subfolder/', $result->getHeader('location')[0]); + static::assertSame('/subfolder/login', $result->getHeader('location')[0]); static::assertSame('UTC', $confSettings['general.timezone']); static::assertSame('Shared bookmarks on http://shaarli', $confSettings['general.title']);