field_filter_xss

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 field_filter_xss($string)

Like filter_xss_admin(), but with a shorter list of allowed tags.

Used for items entered by administrators, like field descriptions, allowed values, where some (mainly inline) mark-up may be desired (so check_plain() is not acceptable).

Related topics

▾ 5 functions call field_filter_xss()

field_default_form in modules/field/field.form.inc
Create a separate form element for each field.
field_multiple_value_form in modules/field/field.form.inc
Special handling to create form elements for multiple values.
list_field_formatter_view in modules/field/modules/list/list.module
Implements hook_field_formatter_view().
number_field_widget_form in modules/field/modules/number/number.module
Implements hook_field_widget_form().
_options_prepare_options in modules/field/modules/options/options.module
Sanitizes the options.

Code

modules/field/field.module, line 786

<?php
function field_filter_xss($string) {
  return filter_xss($string, _field_filter_xss_allowed_tags());
}
?>