Fix encoded html entities in page title (#11979)

* Fix encoded html entities in page title
Seems short sections escape the content

* extra comment for clarification
This commit is contained in:
Tony Murray 2020-07-30 00:27:10 -05:00 committed by GitHub
parent 7822293da4
commit a413187564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,9 @@ class LayoutComposer
{
// build page title
if ($view->getFactory()->hasSection('title')) {
$title = str_replace(' ', ' : ', trim($view->getFactory()->getSection('title')));
// short sections escape the html entities, reverse that
$title = html_entity_decode(trim($view->getFactory()->getSection('title')), ENT_QUOTES);
$title = str_replace(' ', ' : ', $title);
$title .= ' | ' . Config::get('page_title_suffix');
} else {
$title = Config::get('page_title_suffix');
@ -52,10 +54,10 @@ class LayoutComposer
$show_menu = auth()->check();
if ($show_menu && Config::get('twofactor') && !session('twofactor')) {
$show_menu = empty(UserPref::getPref(auth()->user(), 'twofactor'));
$show_menu = empty(UserPref::getPref(auth()->user(), 'twofactor'));
}
$view->with('pagetitle', $title)
->with('show_menu', $show_menu);
->with('show_menu', $show_menu);
}
}