aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/front/ShaarliMiddleware.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/front/ShaarliMiddleware.php')
-rw-r--r--application/front/ShaarliMiddleware.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/application/front/ShaarliMiddleware.php b/application/front/ShaarliMiddleware.php
index 47aa61bb..7ad610c7 100644
--- a/application/front/ShaarliMiddleware.php
+++ b/application/front/ShaarliMiddleware.php
@@ -38,9 +38,9 @@ class ShaarliMiddleware
38 */ 38 */
39 public function __invoke(Request $request, Response $response, callable $next) 39 public function __invoke(Request $request, Response $response, callable $next)
40 { 40 {
41 try { 41 $this->container->basePath = rtrim($request->getUri()->getBasePath(), '/');
42 $this->container->basePath = rtrim($request->getUri()->getBasePath(), '/');
43 42
43 try {
44 $response = $next($request, $response); 44 $response = $next($request, $response);
45 } catch (ShaarliFrontException $e) { 45 } catch (ShaarliFrontException $e) {
46 $this->container->pageBuilder->assign('message', $e->getMessage()); 46 $this->container->pageBuilder->assign('message', $e->getMessage());
@@ -54,7 +54,7 @@ class ShaarliMiddleware
54 $response = $response->withStatus($e->getCode()); 54 $response = $response->withStatus($e->getCode());
55 $response = $response->write($this->container->pageBuilder->render('error')); 55 $response = $response->write($this->container->pageBuilder->render('error'));
56 } catch (UnauthorizedException $e) { 56 } catch (UnauthorizedException $e) {
57 return $response->withRedirect($request->getUri()->getBasePath() . '/login'); 57 return $response->withRedirect($this->container->basePath . '/login');
58 } 58 }
59 59
60 return $response; 60 return $response;