1 views_handler_filter.inc views_handler_filter::prepare_filter_select_options(&$options)

Sanitizes the HTML select element's options.

The function is recursive to support optgroups.

File

core/modules/views/handlers/views_handler_filter.inc, line 1121
@todo.

Class

views_handler_filter
Base class for filters.

Code

function prepare_filter_select_options(&$options) {
  foreach ($options as $value => $label) {
    // Recurse for optgroups.
    if (is_array($label)) {
      $this->prepare_filter_select_options($options[$value]);
    }
    // FAPI has some special value to allow hierarchy.
    // @see _form_options_flatten
    elseif (is_object($label)) {
      $this->prepare_filter_select_options($options[$value]->option);
    }
    else {
      $options[$value] = strip_tags(decode_entities($label));
    }
  }
}