From 1b339267f86c104154f84f2edbe440153a6f00a5 Mon Sep 17 00:00:00 2001 From: Ian Morland Date: Tue, 16 Mar 2021 01:44:22 +0000 Subject: [PATCH] Canonical URL: Use UrlGenerator in place of extracting the url from request (#122) --- extensions/tags/src/Content/Tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/tags/src/Content/Tags.php b/extensions/tags/src/Content/Tags.php index ca25cbadf..a044c1970 100644 --- a/extensions/tags/src/Content/Tags.php +++ b/extensions/tags/src/Content/Tags.php @@ -94,7 +94,7 @@ class Tags $document->title = $this->translator->trans('flarum-tags.forum.all_tags.meta_title_text'); $document->meta['description'] = $this->translator->trans('flarum-tags.forum.all_tags.meta_description_text'); $document->content = $this->view->make('tags::frontend.content.tags', compact('primaryTags', 'secondaryTags', 'children')); - $document->canonicalUrl = $defaultRoute === '/tags' ? $this->url->to('forum')->base() : $request->getUri()->withQuery(''); + $document->canonicalUrl = $this->url->to('forum')->base().($defaultRoute === '/tags' ? '' : $request->getUri()->getPath()); return $document; }