diff options
Diffstat (limited to 'application/front/controller/visitor/ShaarliVisitorController.php')
-rw-r--r-- | application/front/controller/visitor/ShaarliVisitorController.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/application/front/controller/visitor/ShaarliVisitorController.php b/application/front/controller/visitor/ShaarliVisitorController.php index f12915c1..98423d90 100644 --- a/application/front/controller/visitor/ShaarliVisitorController.php +++ b/application/front/controller/visitor/ShaarliVisitorController.php | |||
@@ -78,16 +78,16 @@ abstract class ShaarliVisitorController | |||
78 | ]; | 78 | ]; |
79 | 79 | ||
80 | foreach ($common_hooks as $name) { | 80 | foreach ($common_hooks as $name) { |
81 | $plugin_data = []; | 81 | $pluginData = []; |
82 | $this->container->pluginManager->executeHooks( | 82 | $this->container->pluginManager->executeHooks( |
83 | 'render_' . $name, | 83 | 'render_' . $name, |
84 | $plugin_data, | 84 | $pluginData, |
85 | [ | 85 | [ |
86 | 'target' => $template, | 86 | 'target' => $template, |
87 | 'loggedin' => $this->container->loginManager->isLoggedIn() | 87 | 'loggedin' => $this->container->loginManager->isLoggedIn() |
88 | ] | 88 | ] |
89 | ); | 89 | ); |
90 | $this->assignView('plugins_' . $name, $plugin_data); | 90 | $this->assignView('plugins_' . $name, $pluginData); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
@@ -102,9 +102,10 @@ abstract class ShaarliVisitorController | |||
102 | Request $request, | 102 | Request $request, |
103 | Response $response, | 103 | Response $response, |
104 | array $loopTerms = [], | 104 | array $loopTerms = [], |
105 | array $clearParams = [] | 105 | array $clearParams = [], |
106 | string $anchor = null | ||
106 | ): Response { | 107 | ): Response { |
107 | $defaultPath = $request->getUri()->getBasePath(); | 108 | $defaultPath = rtrim($request->getUri()->getBasePath(), '/') . '/'; |
108 | $referer = $this->container->environment['HTTP_REFERER'] ?? null; | 109 | $referer = $this->container->environment['HTTP_REFERER'] ?? null; |
109 | 110 | ||
110 | if (null !== $referer) { | 111 | if (null !== $referer) { |
@@ -133,7 +134,8 @@ abstract class ShaarliVisitorController | |||
133 | } | 134 | } |
134 | 135 | ||
135 | $queryString = count($params) > 0 ? '?'. http_build_query($params) : ''; | 136 | $queryString = count($params) > 0 ? '?'. http_build_query($params) : ''; |
137 | $anchor = $anchor ? '#' . $anchor : ''; | ||
136 | 138 | ||
137 | return $response->withRedirect($path . $queryString); | 139 | return $response->withRedirect($path . $queryString . $anchor); |
138 | } | 140 | } |
139 | } | 141 | } |