diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php index cf75facc8a..bc3efc7592 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php @@ -2,7 +2,6 @@ namespace Drupal\Core\Field\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\AllowedTagsXssTrait; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Form\FormStateInterface; @@ -12,8 +11,6 @@ */ abstract class NumericFormatterBase extends FormatterBase { - use AllowedTagsXssTrait; - /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/Field/WidgetBase.php b/core/lib/Drupal/Core/Field/WidgetBase.php index 63671576b2..e6978cdc62 100644 --- a/core/lib/Drupal/Core/Field/WidgetBase.php +++ b/core/lib/Drupal/Core/Field/WidgetBase.php @@ -17,8 +17,6 @@ */ abstract class WidgetBase extends PluginSettingsBase implements WidgetInterface { - use AllowedTagsXssTrait; - /** * The field definition. * diff --git a/core/modules/field_ui/src/Form/FieldConfigEditForm.php b/core/modules/field_ui/src/Form/FieldConfigEditForm.php index 34868add47..9b9f05d92f 100644 --- a/core/modules/field_ui/src/Form/FieldConfigEditForm.php +++ b/core/modules/field_ui/src/Form/FieldConfigEditForm.php @@ -3,7 +3,6 @@ namespace Drupal\field_ui\Form; use Drupal\Core\Entity\EntityForm; -use Drupal\Core\Field\AllowedTagsXssTrait; use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; @@ -17,8 +16,6 @@ */ class FieldConfigEditForm extends EntityForm { - use AllowedTagsXssTrait; - /** * The entity being used by this form. * diff --git a/core/modules/options/options.module b/core/modules/options/options.module index 7cf3635529..8971ea43f5 100644 --- a/core/modules/options/options.module +++ b/core/modules/options/options.module @@ -51,7 +51,7 @@ function options_field_storage_config_delete(FieldStorageConfigInterface $field_ * Returns the array of allowed values for a list field. * * The strings are not safe for output. Keys and values of the array should be - * sanitized through \Drupal\Core\Field\AllowedTagsXssTrait::fieldFilterXss() + * sanitized through \Drupal\Core\Field\FieldFilteredMarkup::create() * before being displayed. * * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition diff --git a/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsDefaultFormatter.php b/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsDefaultFormatter.php index ba1ba9c2b3..5ad9539d3e 100644 --- a/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsDefaultFormatter.php +++ b/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsDefaultFormatter.php @@ -2,7 +2,6 @@ namespace Drupal\options\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\AllowedTagsXssTrait; use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FieldItemListInterface; @@ -23,8 +22,6 @@ */ class OptionsDefaultFormatter extends FormatterBase { - use AllowedTagsXssTrait; - /** * {@inheritdoc} */ diff --git a/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php b/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php index 64f22e9b44..9a9165219a 100644 --- a/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php +++ b/core/modules/options/src/Plugin/Field/FieldFormatter/OptionsKeyFormatter.php @@ -2,7 +2,6 @@ namespace Drupal\options\Plugin\Field\FieldFormatter; -use Drupal\Core\Field\AllowedTagsXssTrait; use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FieldItemListInterface; @@ -22,8 +21,6 @@ */ class OptionsKeyFormatter extends FormatterBase { - use AllowedTagsXssTrait; - /** * {@inheritdoc} */ diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListFloatItem.php b/core/modules/options/src/Plugin/Field/FieldType/ListFloatItem.php index 416f7dc2ec..82c6591401 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListFloatItem.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListFloatItem.php @@ -4,6 +4,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; +use Drupal\Core\Field\FieldFilteredMarkup; /** * Plugin implementation of the 'list_float' field type. @@ -55,7 +56,7 @@ protected function allowedValuesDescription() { $description .= '
' . t('The label is optional: if a line contains a single number, it will be used as key and label.'); $description .= '
' . t('Lists of labels are also accepted (one label per line), only if the field does not hold any values yet. Numeric keys will be automatically generated from the positions in the list.'); $description .= '

'; - $description .= '

' . t('Allowed HTML tags in labels: @tags', ['@tags' => $this->displayAllowedTags()]) . '

'; + $description .= '

' . t('Allowed HTML tags in labels: @tags', ['@tags' => FieldFilteredMarkup::displayAllowedTags()]) . '

'; return $description; } diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php b/core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php index b8a4204806..86fab32a50 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php @@ -4,6 +4,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; +use Drupal\Core\Field\FieldFilteredMarkup; /** * Plugin implementation of the 'list_integer' field type. @@ -55,7 +56,7 @@ protected function allowedValuesDescription() { $description .= '
' . t('The label is optional: if a line contains a single number, it will be used as key and label.'); $description .= '
' . t('Lists of labels are also accepted (one label per line), only if the field does not hold any values yet. Numeric keys will be automatically generated from the positions in the list.'); $description .= '

'; - $description .= '

' . t('Allowed HTML tags in labels: @tags', ['@tags' => $this->displayAllowedTags()]) . '

'; + $description .= '

' . t('Allowed HTML tags in labels: @tags', ['@tags' => FieldFilteredMarkup::displayAllowedTags()]) . '

'; return $description; } diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php index 3b29b04b81..f7b95dfd1e 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php @@ -2,7 +2,6 @@ namespace Drupal\options\Plugin\Field\FieldType; -use Drupal\Core\Field\AllowedTagsXssTrait; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\Form\FormStateInterface; @@ -15,8 +14,6 @@ */ abstract class ListItemBase extends FieldItemBase implements OptionsProviderInterface { - use AllowedTagsXssTrait; - /** * {@inheritdoc} */ diff --git a/core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php b/core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php index 1f8caeaf36..0c2811dc55 100644 --- a/core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php +++ b/core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php @@ -5,6 +5,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; +use Drupal\Core\Field\FieldFilteredMarkup; /** * Plugin implementation of the 'list_string' field type. @@ -57,7 +58,7 @@ protected function allowedValuesDescription() { $description .= '
' . t('The key is the stored value. The label will be used in displayed values and edit forms.'); $description .= '
' . t('The label is optional: if a line contains a single string, it will be used as key and label.'); $description .= '

'; - $description .= '

' . t('Allowed HTML tags in labels: @tags', ['@tags' => $this->displayAllowedTags()]) . '

'; + $description .= '

' . t('Allowed HTML tags in labels: @tags', ['@tags' => FieldFilteredMarkup::displayAllowedTags()]) . '

'; return $description; } diff --git a/core/modules/options/src/Plugin/views/argument/NumberListField.php b/core/modules/options/src/Plugin/views/argument/NumberListField.php index d3deeacc78..3a94c7bdd8 100644 --- a/core/modules/options/src/Plugin/views/argument/NumberListField.php +++ b/core/modules/options/src/Plugin/views/argument/NumberListField.php @@ -2,7 +2,6 @@ namespace Drupal\options\Plugin\views\argument; -use Drupal\Core\Field\AllowedTagsXssTrait; use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Form\FormStateInterface; use Drupal\views\FieldAPIHandlerTrait; @@ -20,7 +19,6 @@ */ class NumberListField extends NumericArgument { - use AllowedTagsXssTrait; use FieldAPIHandlerTrait; /** diff --git a/core/modules/options/src/Plugin/views/argument/StringListField.php b/core/modules/options/src/Plugin/views/argument/StringListField.php index 93c43a05ee..b6642d267e 100644 --- a/core/modules/options/src/Plugin/views/argument/StringListField.php +++ b/core/modules/options/src/Plugin/views/argument/StringListField.php @@ -2,7 +2,6 @@ namespace Drupal\options\Plugin\views\argument; -use Drupal\Core\Field\AllowedTagsXssTrait; use Drupal\Core\Field\FieldFilteredMarkup; use Drupal\Core\Form\FormStateInterface; use Drupal\views\FieldAPIHandlerTrait; @@ -19,7 +18,6 @@ */ class StringListField extends StringArgument { - use AllowedTagsXssTrait; use FieldAPIHandlerTrait; /**