You are here

function variable_format_string in Variable 7.2

Format variable as string. Either check plain for filter_xss.

1 string reference to 'variable_format_string'
variable_variable_type_info in ./variable.variable.inc
Implements hook_variable_type_info().

File

./variable.variable.inc, line 296
Variable module hook implementations

Code

function variable_format_string($variable, $options = array()) {
  if (empty($variable['value'])) {
    return '';
  }
  elseif (!empty($variable['allowed tags'])) {
    return filter_xss($variable['value'], $variable['allowed tags']);
  }
  else {
    return check_plain($variable['value']);
  }
}