1 handlers.inc views_handler::sanitize_value($value, $type = NULL)

Sanitize the value for output.

Parameters

$value: The value being rendered.

$type: The type of sanitization needed. If not provided, check_plain() is used.

Return value

string: Returns the safe value.

File

core/modules/views/includes/handlers.inc, line 211
Defines the various handler objects to help build and display views.

Class

views_handler
Base handler, from which all the other handlers are derived. It creates a common interface to create consistency amongst handlers and data.

Code

function sanitize_value($value, $type = NULL) {
  switch ($type) {
    case 'xss':
      $value = filter_xss($value);
      break;
    case 'xss_admin':
      $value = filter_xss_admin($value);
      break;
    case 'url':
      $value = check_url($value);
      break;
    default:
      $value = check_plain($value);
      break;
  }
  return $value;
}