You are here

protected function EntityReferenceViewsOptionsSelectWidget::sanitizeLabel in Entity Reference Views Select 8

Sanitizes a string label to display as an option.

Parameters

string $label: The label to sanitize.

Overrides OptionsWidgetBase::sanitizeLabel

File

src/Plugin/Field/FieldWidget/EntityReferenceViewsOptionsSelectWidget.php, line 139

Class

EntityReferenceViewsOptionsSelectWidget
Plugin implementation of the 'erviews_options_select' widget.

Namespace

Drupal\entity_reference_views_select\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));
}