Commit b13bf919 authored by catch's avatar catch

Issue #2187829 by longwave, IshaDakota, ianthomas_uk, richard.c.allen2386:...

Issue #2187829 by longwave, IshaDakota, ianthomas_uk, richard.c.allen2386: Convert all calls to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in core/modules/views.
parent 824d4b9d
......@@ -169,7 +169,7 @@ public function isOptional() {
*/
public function adminLabel($short = FALSE) {
if (!empty($this->options['admin_label'])) {
$title = check_plain($this->options['admin_label']);
$title = String::checkPlain($this->options['admin_label']);
return $title;
}
$title = ($short && isset($this->definition['title short'])) ? $this->definition['title short'] : $this->definition['title'];
......@@ -216,7 +216,7 @@ public function getField($field = NULL) {
* @param $value
* The value being rendered.
* @param $type
* The type of sanitization needed. If not provided, check_plain() is used.
* The type of sanitization needed. If not provided, String::checkPlain() is used.
*
* @return string
* Returns the safe value.
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views;
use Drupal\Component\Utility\String;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase as ComponentPluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
......@@ -266,9 +267,9 @@ public function summaryTitle() {
public function pluginTitle() {
// Short_title is optional so its defaults to an empty string.
if (!empty($this->definition['short_title'])) {
return check_plain($this->definition['short_title']);
return String::checkPlain($this->definition['short_title']);
}
return check_plain($this->definition['title']);
return String::checkPlain($this->definition['title']);
}
/**
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\argument;
use Drupal\Component\Utility\String as UtilityString;
use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
......@@ -864,7 +865,7 @@ public function summaryName($data) {
if (empty($value) && !empty($this->definition['empty field name'])) {
$value = $this->definition['empty field name'];
}
return check_plain($value);
return UtilityString::checkPlain($value);
}
/**
......@@ -883,7 +884,7 @@ public function query($group_by = FALSE) {
* This usually needs to be overridden to provide a proper title.
*/
function title() {
return check_plain($this->argument);
return UtilityString::checkPlain($this->argument);
}
/**
......
......@@ -284,7 +284,7 @@ function title() {
* Override for specific title lookups.
*/
public function titleQuery() {
return drupal_map_assoc($this->value, 'check_plain');
return drupal_map_assoc($this->value, '\Drupal\Component\Utility\String::checkPlain');
}
public function summaryName($data) {
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\display;
use Drupal\Component\Utility\String;
use Drupal\views\ViewExecutable;
/**
......@@ -90,7 +91,7 @@ public function optionsSummary(&$categories, &$options) {
elseif (count($displays) == 1) {
$display = array_shift($displays);
if ($display = $this->view->storage->getDisplay($display)) {
$attach_to = check_plain($display['display_title']);
$attach_to = String::checkPlain($display['display_title']);
}
}
......
......@@ -1042,7 +1042,7 @@ public function getArgumentsTokens() {
}
// Use strip tags as there should never be HTML in the path.
// However, we need to preserve special characters like " that
// were removed by check_plain().
// were removed by String::checkPlain().
$tokens["!$count"] = isset($this->view->args[$count - 1]) ? strip_tags(decode_entities($this->view->args[$count - 1])) : '';
}
......@@ -1103,12 +1103,12 @@ public function optionsSummary(&$categories, &$options) {
$options['display_id'] = array(
'category' => 'other',
'title' => t('Machine Name'),
'value' => !empty($this->display['new_id']) ? check_plain($this->display['new_id']) : check_plain($this->display['id']),
'value' => !empty($this->display['new_id']) ? String::checkPlain($this->display['new_id']) : String::checkPlain($this->display['id']),
'desc' => t('Change the machine name of this display.'),
);
}
$display_comment = check_plain(drupal_substr($this->getOption('display_comment'), 0, 10));
$display_comment = String::checkPlain(drupal_substr($this->getOption('display_comment'), 0, 10));
$options['display_comment'] = array(
'category' => 'other',
'title' => t('Administrative comment'),
......@@ -1349,7 +1349,7 @@ public function optionsSummary(&$categories, &$options) {
$options['exposed_form']['links']['exposed_form_options'] = t('Exposed form settings for this exposed form style.');
}
$css_class = check_plain(trim($this->getOption('css_class')));
$css_class = String::checkPlain(trim($this->getOption('css_class')));
if (!$css_class) {
$css_class = t('None');
}
......@@ -1381,7 +1381,7 @@ public function buildOptionsForm(&$form, &$form_state) {
if ($this->defaultableSections($form_state['section'])) {
views_ui_standard_display_dropdown($form, $form_state, $form_state['section']);
}
$form['#title'] = check_plain($this->display['display_title']) . ': ';
$form['#title'] = String::checkPlain($this->display['display_title']) . ': ';
// Set the 'section' to hilite on the form.
// If it's the item we're looking at is pulling from the default display,
......@@ -1904,7 +1904,7 @@ public function buildOptionsForm(&$form, &$form_state) {
}
else {
$output .= '<p>' . t('This is the default theme template used for this display.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $this->definition['theme_path'] . '/' . strtr($this->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
$output .= '<pre>' . String::checkPlain(file_get_contents('./' . $this->definition['theme_path'] . '/' . strtr($this->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
}
$form['analysis'] = array(
......@@ -1924,7 +1924,7 @@ public function buildOptionsForm(&$form, &$form_state) {
}
else {
$output .= '<p>' . t('This is the default theme template used for this style.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $plugin->definition['theme_path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
$output .= '<pre>' . String::checkPlain(file_get_contents('./' . $plugin->definition['theme_path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
}
$form['analysis'] = array(
......@@ -1944,7 +1944,7 @@ public function buildOptionsForm(&$form, &$form_state) {
}
else {
$output .= '<p>' . t('This is the default theme template used for this row style.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $plugin->definition['theme_path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
$output .= '<pre>' . String::checkPlain(file_get_contents('./' . $plugin->definition['theme_path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
}
$form['analysis'] = array(
......@@ -1961,7 +1961,7 @@ public function buildOptionsForm(&$form, &$form_state) {
// Field templates aren't registered the normal way...and they're always
// this one, anyhow.
$output .= '<pre>' . check_plain(file_get_contents(drupal_get_path('module', 'views') . '/templates/views-view-field.tpl.php')) . '</pre>';
$output .= '<pre>' . String::checkPlain(file_get_contents(drupal_get_path('module', 'views') . '/templates/views-view-field.tpl.php')) . '</pre>';
$form['analysis'] = array(
'#markup' => '<div class="form-item">' . $output . '</div>',
......
......@@ -174,7 +174,7 @@ public function optionsSummary(&$categories, &$options) {
$display = array_shift($displays);
$displays = $this->view->storage->get('display');
if (!empty($displays[$display])) {
$attach_to = check_plain($displays[$display]['display_title']);
$attach_to = String::checkPlain($displays[$display]['display_title']);
}
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\exposed_form;
use Drupal\Component\Utility\String;
use Drupal\views\Form\ViewsExposedForm;
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
......@@ -199,7 +200,7 @@ public function exposedFormAlter(&$form, &$form_state) {
$exposed_sorts = array();
foreach ($this->view->sort as $id => $handler) {
if ($handler->canExpose() && $handler->isExposed()) {
$exposed_sorts[$id] = check_plain($handler->options['expose']['label']);
$exposed_sorts[$id] = String::checkPlain($handler->options['expose']['label']);
}
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\field;
use Drupal\Component\Utility\String;
use Drupal\views\Plugin\views\HandlerBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ResultRow;
......@@ -206,7 +207,7 @@ public function elementType($none_supported = FALSE, $default_empty = FALSE, $in
}
}
if ($this->options['element_type']) {
return check_plain($this->options['element_type']);
return String::checkPlain($this->options['element_type']);
}
if ($default_empty) {
......@@ -234,7 +235,7 @@ public function elementLabelType($none_supported = FALSE, $default_empty = FALSE
}
}
if ($this->options['element_label_type']) {
return check_plain($this->options['element_label_type']);
return String::checkPlain($this->options['element_label_type']);
}
if ($default_empty) {
......@@ -254,7 +255,7 @@ public function elementWrapperType($none_supported = FALSE, $default_empty = FAL
}
}
if ($this->options['element_wrapper_type']) {
return check_plain($this->options['element_wrapper_type']);
return String::checkPlain($this->options['element_wrapper_type']);
}
if ($default_empty) {
......@@ -1329,7 +1330,7 @@ protected function renderAsLink($alter, $text, $tokens) {
if ($path != '<front>') {
// Use strip tags as there should never be HTML in the path.
// However, we need to preserve special characters like " that
// were removed by check_plain().
// were removed by String::checkPlain().
$path = strip_tags(decode_entities(strtr($path, $tokens)));
if (!empty($alter['path_case']) && $alter['path_case'] != 'none') {
......@@ -1405,7 +1406,7 @@ protected function renderAsLink($alter, $text, $tokens) {
$options['attributes']['rel'] = $rel;
}
$target = check_plain(trim(strtr($alter['target'], $tokens)));
$target = String::checkPlain(trim(strtr($alter['target'], $tokens)));
if (!empty($target)) {
$options['attributes']['target'] = $target;
}
......@@ -1480,7 +1481,7 @@ public function getRenderTokens($item) {
// Use strip tags as there should never be HTML in the path.
// However, we need to preserve special characters like " that
// were removed by check_plain().
// were removed by String::checkPlain().
$tokens['!' . $count] = isset($this->view->args[$count - 1]) ? strip_tags(decode_entities($this->view->args[$count - 1])) : '';
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\field;
use Drupal\Component\Utility\String;
use Drupal\views\ResultRow;
/**
......@@ -72,7 +73,7 @@ public function preRender(&$values) {
public function render(ResultRow $values) {
$value = $values->{$this->field_alias};
if (!empty($this->options['machine_name']) || !isset($this->valueOptions[$value])) {
$result = check_plain($value);
$result = String::checkPlain($value);
}
else {
$result = $this->valueOptions[$value];
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\field;
use Drupal\Component\Utility\String;
use Drupal\views\ResultRow;
/**
......@@ -66,11 +67,11 @@ public function render(ResultRow $values) {
$value = $values->{$this->field_alias};
if ($this->options['format'] == 'unserialized') {
return check_plain(print_r(unserialize($value), TRUE));
return String::checkPlain(print_r(unserialize($value), TRUE));
}
elseif ($this->options['format'] == 'key' && !empty($this->options['key'])) {
$value = (array) unserialize($value);
return check_plain($value[$this->options['key']]);
return String::checkPlain($value[$this->options['key']]);
}
return $value;
......
......@@ -8,7 +8,7 @@
namespace Drupal\views\Plugin\views\filter;
use Drupal\views\Plugin\views\HandlerBase;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\String as UtilityString;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
......@@ -163,7 +163,7 @@ protected function defineOptions() {
* Display the filter on the administrative summary
*/
public function adminSummary() {
return check_plain((string) $this->operator) . ' ' . check_plain((string) $this->value);
return UtilityString::checkPlain((string) $this->operator) . ' ' . UtilityString::checkPlain((string) $this->value);
}
/**
......@@ -574,7 +574,7 @@ public function buildExposeForm(&$form, &$form_state) {
'#default_value' => $this->options['expose']['remember'],
);
$role_options = array_map('check_plain', user_role_names());
$role_options = array_map('\Drupal\Component\Utility\String::checkPlain', user_role_names());
$form['expose']['remember_roles'] = array(
'#type' => 'checkboxes',
'#title' => t('User roles'),
......@@ -745,7 +745,7 @@ public function groupForm(&$form, &$form_state) {
$value = $this->options['group_info']['identifier'];
$form[$value] = array(
'#title' => String::checkPlain($this->options['group_info']['label']),
'#title' => UtilityString::checkPlain($this->options['group_info']['label']),
'#type' => $this->options['group_info']['widget'],
'#default_value' => $this->group_info,
'#options' => $groups,
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\filter;
use Drupal\Component\Utility\String as UtilityString;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
......@@ -321,7 +322,7 @@ public function adminSummary() {
return;
}
$operator = check_plain($info[$this->operator]['short']);
$operator = UtilityString::checkPlain($info[$this->operator]['short']);
$values = '';
if (in_array($this->operator, $this->operatorValues(1))) {
// Remove every element which is not known.
......@@ -337,13 +338,13 @@ public function adminSummary() {
else if (count($this->value) == 1) {
// If any, use the 'single' short name of the operator instead.
if (isset($info[$this->operator]['short_single'])) {
$operator = check_plain($info[$this->operator]['short_single']);
$operator = UtilityString::checkPlain($info[$this->operator]['short_single']);
}
$keys = $this->value;
$value = array_shift($keys);
if (isset($this->value_options[$value])) {
$values = check_plain($this->value_options[$value]);
$values = UtilityString::checkPlain($this->value_options[$value]);
}
else {
$values = '';
......@@ -359,7 +360,7 @@ public function adminSummary() {
break;
}
if (isset($this->value_options[$value])) {
$values .= check_plain($this->value_options[$value]);
$values .= UtilityString::checkPlain($this->value_options[$value]);
}
}
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\filter;
use Drupal\Component\Utility\String as UtilityString;
use Drupal\Core\Database\Database;
/**
......@@ -287,12 +288,12 @@ public function adminSummary() {
}
$options = $this->operatorOptions('short');
$output = check_plain($options[$this->operator]);
$output = UtilityString::checkPlain($options[$this->operator]);
if (in_array($this->operator, $this->operatorValues(2))) {
$output .= ' ' . t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));
}
elseif (in_array($this->operator, $this->operatorValues(1))) {
$output .= ' ' . check_plain($this->value['value']);
$output .= ' ' . UtilityString::checkPlain($this->value['value']);
}
return $output;
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\filter;
use Drupal\Component\Utility\String as UtilityString;
use Drupal\Core\Database\Database;
/**
......@@ -160,10 +161,10 @@ public function adminSummary() {
$options = $this->operatorOptions('short');
$output = '';
if (!empty($options[$this->operator])) {
$output = check_plain($options[$this->operator]);
$output = UtilityString::checkPlain($options[$this->operator]);
}
if (in_array($this->operator, $this->operatorValues(1))) {
$output .= ' ' . check_plain($this->value);
$output .= ' ' . UtilityString::checkPlain($this->value);
}
return $output;
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\row;
use Drupal\Component\Utility\String;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
......@@ -133,7 +134,7 @@ protected function buildViewModeOptions() {
public function summaryTitle() {
$options = $this->buildViewModeOptions();
if (isset($options[$this->options['view_mode']])) {
return check_plain($options[$this->options['view_mode']]);
return String::checkPlain($options[$this->options['view_mode']]);
}
else {
return t('No view mode selected');
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Tests;
use Drupal\Component\Utility\String;
use Drupal\views\Tests\ViewTestBase;
use Drupal\Core\Language\Language;
......@@ -82,7 +83,7 @@ public function testTaxonomyAutocomplete() {
$label = $this->term1->label();
$expected = array(array(
'value' => $label,
'label' => check_plain($label),
'label' => String::checkPlain($label),
));
$this->assertIdentical($expected, $this->drupalGetJSON($base_autocomplete_path, array('query' => array('q' => $label))));
// Test a term by partial name.
......
......@@ -1108,7 +1108,7 @@ function views_get_view_result($name, $display_id = NULL) {
}
/**
* #process callback to see if we need to check_plain() the options.
* #process callback to see if we need to String::checkPlain() the options.
*
* Since FAPI is inconsistent, the #options are sanitized for you in all cases
* _except_ checkboxes. We have form elements that are sometimes 'select' and
......@@ -1118,7 +1118,7 @@ function views_get_view_result($name, $display_id = NULL) {
*/
function views_process_check_options($element, &$form_state) {
if ($element['#type'] == 'checkboxes' || $element['#type'] == 'checkbox') {
$element['#options'] = array_map('check_plain', $element['#options']);
$element['#options'] = array_map('\Drupal\Component\Utility\String::checkPlain', $element['#options']);
}
return $element;
}
......
......@@ -5,6 +5,7 @@
* Preprocessors and helper functions to make theming easier.
*/
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Language\Language;
use Drupal\Core\Template\Attribute;
......@@ -114,8 +115,8 @@ function template_preprocess_views_view(&$variables) {
'views_dom_id:' . $variables['dom_id'] => array(
'view_name' => $view->storage->id(),
'view_display_id' => $view->current_display,
'view_args' => check_plain(implode('/', $view->args)),
'view_path' => check_plain(current_path()),
'view_args' => String::checkPlain(implode('/', $view->args)),
'view_path' => String::checkPlain(current_path()),
'view_base_path' => $view->getPath(),
'view_dom_id' => $variables['dom_id'],
// To fit multiple views on a page, the programmer may have
......@@ -261,7 +262,7 @@ function template_preprocess_views_view_fields(&$variables) {
// Set up the label for the value and the HTML to make it easier
// on the template.
$object->label = check_plain($view->field[$id]->label());
$object->label = String::checkPlain($view->field[$id]->label());
$object->label_html = '';
if ($object->label) {
$object->label_html .= $object->label;
......@@ -548,7 +549,7 @@ function template_preprocess_views_view_table(&$variables) {
// Render the header labels.
if ($field == $column && empty($fields[$field]->options['exclude'])) {
$label = check_plain(!empty($fields[$field]) ? $fields[$field]->label() : '');
$label = String::checkPlain(!empty($fields[$field]) ? $fields[$field]->label() : '');
if (empty($options['info'][$field]['sortable']) || !$fields[$field]->clickSortable()) {
$variables['header'][$field]['content'] = $label;
}
......@@ -980,7 +981,7 @@ function template_preprocess_views_view_rss(&$variables) {
// The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
// We strip all HTML tags, but need to prevent double encoding from properly
// escaped source data (such as &amp becoming &amp;amp;).
$variables['description'] = check_plain(decode_entities(strip_tags($style->getDescription())));
$variables['description'] = String::checkPlain(decode_entities(strip_tags($style->getDescription())));
if ($view->display_handler->getOption('sitename_title')) {
$title = $config->get('name');
......@@ -991,7 +992,7 @@ function template_preprocess_views_view_rss(&$variables) {
else {
$title = $view->getTitle();
}
$variables['title'] = check_plain($title);
$variables['title'] = String::checkPlain($title);
// Figure out which display which has a path we're using for this feed. If
// there isn't one, use the global $base_url
......@@ -1016,7 +1017,7 @@ function template_preprocess_views_view_rss(&$variables) {
$variables['link'] = check_url(url($path, $url_options));
}
$variables['langcode'] = check_plain(language(Language::TYPE_INTERFACE)->id);
$variables['langcode'] = String::checkPlain(language(Language::TYPE_INTERFACE)->id);
$variables['namespaces'] = new Attribute($style->namespaces);
$variables['items'] = $items;
$variables['channel_elements'] = format_xml_elements($style->channel_elements);
......@@ -1040,9 +1041,9 @@ function template_preprocess_views_view_rss(&$variables) {
function template_preprocess_views_view_row_rss(&$variables) {
$item = $variables['row'];
$variables['title'] = check_plain($item->title);
$variables['title'] = String::checkPlain($item->title);
$variables['link'] = check_url($item->link);
$variables['description'] = check_plain($item->description);
$variables['description'] = String::checkPlain($item->description);
$variables['item_elements'] = empty($item->elements) ? '' : format_xml_elements($item->elements);
}
......
......@@ -5,6 +5,8 @@
* Token integration for the views module.
*/
use Drupal\Component\Utility\String;
/**
* Implements hook_token_info().
*/
......@@ -83,11 +85,11 @@ function views_tokens($type, $tokens, array $data = array(), array $options = ar
foreach ($tokens as $name => $original) {
switch ($name) {
case 'label':
$replacements[$original] = $sanitize ? check_plain($view->storage->label()) : $view->storage->label();
$replacements[$original] = $sanitize ? String::checkPlain($view->storage->label()) : $view->storage->label();
break;
case 'description':
$replacements[$original] = $sanitize ? check_plain($view->storage->get('description')) : $view->storage->get('description');
$replacements[$original] = $sanitize ? String::checkPlain($view->storage->get('description')) : $view->storage->get('description');
break;
case 'id':
......@@ -96,7 +98,7 @@ function views_tokens($type, $tokens, array $data = array(), array $options = ar
case 'title':
$title = $view->getTitle();
$replacements[$original] = $sanitize ? check_plain($title) : $title;
$replacements[$original] = $sanitize ? String::checkPlain($title) : $title;
break;
case 'url':
......
......@@ -7,6 +7,7 @@
namespace Drupal\views_ui\Controller;
use Drupal\Component\Utility\String;
use Drupal\Core\Controller\ControllerBase;
use Drupal\views\ViewExecutable;
use Drupal\views\ViewStorageInterface;
......@@ -86,7 +87,7 @@ public function reportFields() {
$header = array(t('Field name'), t('Used in'));
$rows = array();
foreach ($fields as $field_name => $views) {
$rows[$field_name]['data'][0] = check_plain($field_name);
$rows[$field_name]['data'][0] = String::checkPlain($field_name);
foreach ($views as $view) {
$rows[$field_name]['data'][1][] = $this->l($view, 'views_ui.edit', array('view' => $view));
}
......
......@@ -11,6 +11,7 @@
use Drupal\Core\Ajax\HtmlCommand;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\String;
use Drupal\user\TempStoreFactory;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -469,7 +470,7 @@ public function getDisplayDetails($view, $display) {
$build['top']['display_title'] = array(
'#theme' => 'views_ui_display_tab_setting',
'#description' => $this->t('Display name'),
'#link' => $view->getExecutable()->displayHandlers->get($display['id'])->optionLink(check_plain($display_title), 'display_title'),
'#link' => $view->getExecutable()->displayHandlers->get($display['id'])->optionLink(String::checkPlain($display_title), 'display_title'),
);