You are here

protected static function SelectOrOtherWidgetBase::sanitizeLabel in Select (or other) 8.3

Sanitizes a string label to display as an option.

Parameters

string $label: The label to sanitize.

1 method overrides SelectOrOtherWidgetBase::sanitizeLabel()
Widget::sanitizeLabel in src/Plugin/Field/FieldWidget/Widget.php
Sanitizes a string label to display as an option.

File

src/Plugin/Field/FieldWidget/SelectOrOtherWidgetBase.php, line 266
Contains \Drupal\select_or_other\Plugin\Field\FieldWidget\SelectOrOtherWidgetBase.

Class

SelectOrOtherWidgetBase
Base class for the 'select_or_other_*' widgets.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

protected static function sanitizeLabel(&$label) {

  // Allow a limited set of HTML tags.
  $label = Xss::filter($label);
}