You are here

protected function OptionsSelectWidget::sanitizeLabel in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsSelectWidget::sanitizeLabel()

Sanitizes a string label to display as an option.

Parameters

string $label: The label to sanitize.

Overrides OptionsWidgetBase::sanitizeLabel

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php, line 46

Class

OptionsSelectWidget
Plugin implementation of the 'options_select' widget.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

protected function sanitizeLabel(&$label) {

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