1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

fix: html entities shown raw in page title (#3542)

This commit is contained in:
David Wheatley
2022-07-18 16:10:34 +01:00
committed by GitHub
parent 8dcfa6c474
commit d0998be8fa
2 changed files with 7 additions and 2 deletions

View File

@@ -414,7 +414,12 @@ export default class Application {
onHomepage || !this.title
? extractText(app.translator.trans('core.lib.meta_titles.without_page_title', params))
: extractText(app.translator.trans('core.lib.meta_titles.with_page_title', params));
document.title = count + title;
const tempEl = document.createElement('div');
tempEl.innerHTML = title;
const decodedTitle = tempEl.innerText;
document.title = count + decodedTitle;
}
protected transformRequestOptions<ResponseType>(flarumOptions: FlarumRequestOptions<ResponseType>): InternalFlarumRequestOptions<ResponseType> {

View File

@@ -3,7 +3,7 @@
@if ($language) lang="{{ $language }}" @endif>
<head>
<meta charset="utf-8">
<title>{{ $title }}</title>
<title>{!! $title !!}</title>
{!! $head !!}
</head>