X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=application%2Ffront%2Fcontroller%2Fvisitor%2FShaarliVisitorController.php;h=b494a8e6bed3587a1edf66ebe921e7bc2b89cf97;hb=204035bd3c91b9a5c39fcb6fc470e108b032dbd9;hp=b90b1e8f2f8396ef3eff59221b15db749a7be516;hpb=818b3193ffabec57501e3bdfa997206e3c0671ef;p=github%2Fshaarli%2FShaarli.git diff --git a/application/front/controller/visitor/ShaarliVisitorController.php b/application/front/controller/visitor/ShaarliVisitorController.php index b90b1e8f..b494a8e6 100644 --- a/application/front/controller/visitor/ShaarliVisitorController.php +++ b/application/front/controller/visitor/ShaarliVisitorController.php @@ -104,6 +104,19 @@ abstract class ShaarliVisitorController } } + /** + * Simple helper which prepend the base path to redirect path. + * + * @param Response $response + * @param string $path Absolute path, e.g.: `/`, or `/admin/shaare/123` regardless of install directory + * + * @return Response updated + */ + protected function redirect(Response $response, string $path): Response + { + return $response->withRedirect($this->container->basePath . $path); + } + /** * Generates a redirection to the previous page, based on the HTTP_REFERER. * It fails back to the home page.