| 7 options.module | _options_prepare_options(&$options, $properties) |
| 8 options.module | _options_prepare_options(&$options, $properties) |
Sanitizes the options.
The function is recursive to support optgroups.
1 call to _options_prepare_options()
File
- modules/
field/ modules/ options/ options.module, line 267 - Defines selection, check box and radio button widgets for text and numeric fields.
Code
function _options_prepare_options(&$options, $properties) {
foreach ($options as $value => $label) {
// Recurse for optgroups.
if (is_array($label)) {
_options_prepare_options($options[$value], $properties);
}
else {
if ($properties['strip_tags']) {
$options[$value] = strip_tags($label);
}
if ($properties['filter_xss']) {
$options[$value] = field_filter_xss($label);
}
}
}
}
Login or register to post comments