protected function render(string $template): string
{
+ // Legacy key that used to be injected by PluginManager
+ $this->assignView('_PAGE_', $template);
+ $this->assignView('template', $template);
+
$this->assignView('linkcount', $this->container->bookmarkService->count(BookmarkFilter::$ALL));
$this->assignView('privateLinkcount', $this->container->bookmarkService->count(BookmarkFilter::$PRIVATE));
if (null !== $referer) {
$currentUrl = parse_url($referer);
// If the referer is not related to Shaarli instance, redirect to default
- if (isset($currentUrl['host'])
+ if (
+ isset($currentUrl['host'])
&& strpos(index_url($this->container->environment), $currentUrl['host']) === false
) {
return $response->withRedirect($defaultPath);
}
}
- $queryString = count($params) > 0 ? '?'. http_build_query($params) : '';
+ $queryString = count($params) > 0 ? '?' . http_build_query($params) : '';
$anchor = $anchor ? '#' . $anchor : '';
return $response->withRedirect($path . $queryString . $anchor);