function 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 47
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));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.