protected static function SelectWidget::sanitizeLabel

Sanitizes a string label to display as an option.

Parameters

string $label: The label to sanitize.

Overrides OptionsWidgetBase::sanitizeLabel

File

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

Class

SelectWidget
Plugin implementation of the 'options_select' widget.

Namespace

Drupal\options\Plugin\field\widget

Code

protected static function sanitizeLabel(&$label) {

  // Select form inputs allow unencoded HTML entities, but no HTML tags.
  $label = strip_tags($label);
}