diff --git a/core/lib/Drupal/Core/Field/FieldFilteredString.php b/core/lib/Drupal/Core/Field/FieldFilteredString.php index 8035e1a..1a513c9 100644 --- a/core/lib/Drupal/Core/Field/FieldFilteredString.php +++ b/core/lib/Drupal/Core/Field/FieldFilteredString.php @@ -16,14 +16,12 @@ /** * Defines an object that passes safe strings through the Field system. * - * This object should only be constructed with a known safe string. If there is - * any risk that the string contains user-entered data that has not been - * filtered first, it must not be used. + * This object filters the string using a very restrictive tag list when it is + * created. * * @internal - * This object is marked as internal because it should only be used in the - * Filter module on strings that have already been been filtered and sanitized - * in \Drupal\filter\Plugin\FilterInterface. + * This object is marked as internal because it should only be used by the + * Field module and field-related plugins. * * @see \Drupal\Core\Render\SafeString */ 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 c30a9d2..883db1b 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php @@ -75,8 +75,8 @@ public function viewElements(FieldItemListInterface $items) { // Account for prefix and suffix. if ($this->getSetting('prefix_suffix')) { - $prefixes = isset($settings['prefix']) ? array_map(array($this, 'fieldFilterXss'), explode('|', $settings['prefix'])) : array(''); - $suffixes = isset($settings['suffix']) ? array_map(array($this, 'fieldFilterXss'), explode('|', $settings['suffix'])) : array(''); + $prefixes = isset($settings['prefix']) ? array_map(array('Drupal\Core\Field\FieldFilteredString', 'create'), explode('|', $settings['prefix'])) : array(''); + $suffixes = isset($settings['suffix']) ? array_map(array('Drupal\Core\Field\FieldFilteredString', 'create'), explode('|', $settings['suffix'])) : array(''); $prefix = (count($prefixes) > 1) ? $this->formatPlural($item->value, $prefixes[0], $prefixes[1]) : $prefixes[0]; $suffix = (count($suffixes) > 1) ? $this->formatPlural($item->value, $suffixes[0], $suffixes[1]) : $suffixes[0]; $output = $prefix . $output . $suffix; diff --git a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php index 0a69144..1449c7f 100644 --- a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php +++ b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php @@ -7,7 +7,6 @@ namespace Drupal\image\Plugin\Field\FieldWidget; -use Drupal\Core\Field\FieldFilteredString; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Form\FormStateInterface; @@ -98,7 +97,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f if ($cardinality == 1) { // If there's only one field, return it as delta 0. if (empty($elements[0]['#default_value']['fids'])) { - $file_upload_help['#description'] = FieldFilteredString::create($this->fieldDefinition->getDescription()); + $file_upload_help['#description'] = $this->fieldDefinition->getDescription(); $elements[0]['#description'] = \Drupal::service('renderer')->renderPlain($file_upload_help); } }