protected function OptionsSelectWidget::sanitizeLabel in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsSelectWidget::sanitizeLabel()
- 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\FieldWidgetCode
protected function sanitizeLabel(&$label) {
// Select form inputs allow unencoded HTML entities, but no HTML tags.
$label = Html::decodeEntities(strip_tags($label));
}