protected static function OptionsWidgetBase::sanitizeLabel

Sanitizes a string label to display as an option.

Parameters

string $label: The label to sanitize.

1 method overrides OptionsWidgetBase::sanitizeLabel()
SelectWidget::sanitizeLabel in drupal/core/modules/options/lib/Drupal/options/Plugin/field/widget/SelectWidget.php
Sanitizes a string label to display as an option.

File

drupal/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php, line 212
Contains \Drupal\options\Plugin\field\widget\OptionsWidgetBase.

Class

OptionsWidgetBase
Base class for the 'options_*' widgets.

Namespace

Drupal\options\Plugin\field\widget

Code

protected static function sanitizeLabel(&$label) {

  // Allow a limited set of HTML tags.
  $label = field_filter_xss($label);
}