diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 236b6d0..79be715 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -484,8 +484,7 @@ function template_preprocess_views_view_table(&$variables) { '#theme' => 'tablesort_indicator', '#style' => $initial, ); - $markup = drupal_render($tablesort_indicator); - $label = SafeMarkup::set($label . $markup); + $label = [['#markup' => $label], $tablesort_indicator]; } $query['order'] = $field; @@ -517,7 +516,7 @@ function template_preprocess_views_view_table(&$variables) { if ($variables['header'][$field]['content']) { $element_label_type = $fields[$field]->elementLabelType(TRUE, TRUE); if ($element_label_type) { - $variables['header'][$field]['content'] = '<' . $element_label_type . '>' . $variables['header'][$field]['content'] . ''; + $variables['header'][$field]['content'] = SafeMarkup::format('<@element_label_type>@content', ['@element_label_type' => $element_label_type, '@content' => $variables['header'][$field]['content']]); } // Improves accessibility of complex tables. $variables['header'][$field]['attributes']['id'] = Html::getUniqueId('view-' . $field . '-table-column'); @@ -576,7 +575,7 @@ function template_preprocess_views_view_table(&$variables) { $field_output = $handler->getField($num, $field); $element_type = $fields[$field]->elementType(TRUE, TRUE); if ($element_type) { - $field_output = SafeMarkup::set('<' . $element_type . '>' . SafeMarkup::escape($field_output) . ''); + $field_output = SafeMarkup::format('<@element_type>@field_output', ['@element_type' => $element_type, '@field_output' => $field_output]); } // Only bother with separators and stuff if the field shows up. @@ -584,17 +583,15 @@ function template_preprocess_views_view_table(&$variables) { // Place the field into the column, along with an optional separator. if (!empty($column_reference['content'])) { if (!empty($options['info'][$column]['separator'])) { - $safe_content = SafeMarkup::escape($column_reference['content']); $safe_separator = Xss::filterAdmin($options['info'][$column]['separator']); - $column_reference['content'] = SafeMarkup::set($safe_content . $safe_separator); + $column_reference['content'] = SafeMarkup::format('@content@separator', ['@content' => $column_reference['content'], '@separator' => $safe_separator]); } } else { $column_reference['content'] = ''; } - $safe_content = SafeMarkup::escape($column_reference['content']); - $safe_field_output = SafeMarkup::escape($field_output); - $column_reference['content'] = SafeMarkup::set($safe_content . $safe_field_output); + $column_reference['content'] = SafeMarkup::format('@content@field_output', ['@content' => $column_reference['content'], '@separator' => $field_output]); + } } $column_reference['attributes'] = new Attribute($column_reference['attributes']);