diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-11-12 13:02:36 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-11-12 13:02:36 +0100 |
commit | 1409f1c89a7ca01456ae2dcd6357d296e2b99f5a (patch) | |
tree | ffa30a9358e82d27be75d8fc5e57f3c8820dc6d3 /application/front/controller/visitor/ShaarliVisitorController.php | |
parent | 054e03f37fa29da8066f1a637919f13c7e7dc5d2 (diff) | |
parent | a6935feb22df8d9634189ee87d257da9f03eedbd (diff) | |
download | Shaarli-v0.12.tar.gz Shaarli-v0.12.tar.zst Shaarli-v0.12.zip |
Diffstat (limited to 'application/front/controller/visitor/ShaarliVisitorController.php')
-rw-r--r-- | application/front/controller/visitor/ShaarliVisitorController.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/application/front/controller/visitor/ShaarliVisitorController.php b/application/front/controller/visitor/ShaarliVisitorController.php index 55c075a2..ae946c59 100644 --- a/application/front/controller/visitor/ShaarliVisitorController.php +++ b/application/front/controller/visitor/ShaarliVisitorController.php | |||
@@ -106,6 +106,7 @@ abstract class ShaarliVisitorController | |||
106 | 'target' => $template, | 106 | 'target' => $template, |
107 | 'loggedin' => $this->container->loginManager->isLoggedIn(), | 107 | 'loggedin' => $this->container->loginManager->isLoggedIn(), |
108 | 'basePath' => $this->container->basePath, | 108 | 'basePath' => $this->container->basePath, |
109 | 'rootPath' => preg_replace('#/index\.php$#', '', $this->container->basePath), | ||
109 | 'bookmarkService' => $this->container->bookmarkService | 110 | 'bookmarkService' => $this->container->bookmarkService |
110 | ]; | 111 | ]; |
111 | } | 112 | } |
@@ -143,7 +144,8 @@ abstract class ShaarliVisitorController | |||
143 | if (null !== $referer) { | 144 | if (null !== $referer) { |
144 | $currentUrl = parse_url($referer); | 145 | $currentUrl = parse_url($referer); |
145 | // If the referer is not related to Shaarli instance, redirect to default | 146 | // If the referer is not related to Shaarli instance, redirect to default |
146 | if (isset($currentUrl['host']) | 147 | if ( |
148 | isset($currentUrl['host']) | ||
147 | && strpos(index_url($this->container->environment), $currentUrl['host']) === false | 149 | && strpos(index_url($this->container->environment), $currentUrl['host']) === false |
148 | ) { | 150 | ) { |
149 | return $response->withRedirect($defaultPath); | 151 | return $response->withRedirect($defaultPath); |
@@ -172,7 +174,7 @@ abstract class ShaarliVisitorController | |||
172 | } | 174 | } |
173 | } | 175 | } |
174 | 176 | ||
175 | $queryString = count($params) > 0 ? '?'. http_build_query($params) : ''; | 177 | $queryString = count($params) > 0 ? '?' . http_build_query($params) : ''; |
176 | $anchor = $anchor ? '#' . $anchor : ''; | 178 | $anchor = $anchor ? '#' . $anchor : ''; |
177 | 179 | ||
178 | return $response->withRedirect($path . $queryString . $anchor); | 180 | return $response->withRedirect($path . $queryString . $anchor); |