Commit 45268c11 authored by alexpott's avatar alexpott

Issue #2369987 by aneek, joelpittet, idebr, pgautam: Remove SafeMarkup::set()...

Issue #2369987 by aneek, joelpittet, idebr, pgautam: Remove SafeMarkup::set() from title on template_preprocess_html
parent 7b5e5a95
......@@ -1332,8 +1332,8 @@ function template_preprocess_html(&$variables) {
// Construct page title.
if (!empty($variables['page']['#title'])) {
$head_title = array(
'title' => SafeMarkup::set(trim(strip_tags($variables['page']['#title']))),
'name' => String::checkPlain($site_config->get('name')),
'title' => trim(strip_tags($variables['page']['#title'])),
'name' => $site_config->get('name'),
);
}
// @todo Remove once views is not bypassing the view subscriber anymore.
......@@ -1341,24 +1341,23 @@ function template_preprocess_html(&$variables) {
elseif ($is_front_page) {
$head_title = array(
'title' => t('Home'),
'name' => String::checkPlain($site_config->get('name')),
'name' => $site_config->get('name'),
);
}
else {
$head_title = array('name' => String::checkPlain($site_config->get('name')));
$head_title = array('name' => $site_config->get('name'));
if ($site_config->get('slogan')) {
$head_title['slogan'] = strip_tags(Xss::filterAdmin($site_config->get('slogan')));
}
}
$variables['head_title_array'] = $head_title;
$output = '';
$separator = '';
foreach ($head_title as $item) {
$output .= $separator . SafeMarkup::escape($item);
$separator = ' | ';
}
$variables['head_title'] = SafeMarkup::set($output);
$variables['head_title'] = array(
'#type' => 'inline_template',
'#template' => '{{ head_title|safe_join(" | ") }}',
'#context' => array('head_title' => $head_title),
);
// Collect all attachments. This must happen in the preprocess function for
// #type => html, to ensure that attachments added in #pre_render callbacks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment