diff options
Diffstat (limited to 'application/front/controller/visitor/ShaarliVisitorController.php')
-rw-r--r-- | application/front/controller/visitor/ShaarliVisitorController.php | 13 |
1 files changed, 13 insertions, 0 deletions
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 | |||
@@ -105,6 +105,19 @@ abstract class ShaarliVisitorController | |||
105 | } | 105 | } |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * Simple helper which prepend the base path to redirect path. | ||
109 | * | ||
110 | * @param Response $response | ||
111 | * @param string $path Absolute path, e.g.: `/`, or `/admin/shaare/123` regardless of install directory | ||
112 | * | ||
113 | * @return Response updated | ||
114 | */ | ||
115 | protected function redirect(Response $response, string $path): Response | ||
116 | { | ||
117 | return $response->withRedirect($this->container->basePath . $path); | ||
118 | } | ||
119 | |||
120 | /** | ||
108 | * Generates a redirection to the previous page, based on the HTTP_REFERER. | 121 | * Generates a redirection to the previous page, based on the HTTP_REFERER. |
109 | * It fails back to the home page. | 122 | * It fails back to the home page. |
110 | * | 123 | * |