function _webform_edit_validate_select in Webform 5
Same name and namespace in other branches
- 5.2 components/select.inc \_webform_edit_validate_select()
- 6.3 components/select.inc \_webform_edit_validate_select()
- 6.2 components/select.inc \_webform_edit_validate_select()
- 7.4 components/select.inc \_webform_edit_validate_select()
- 7.3 components/select.inc \_webform_edit_validate_select()
File
- components/
select.inc, line 49
Code
function _webform_edit_validate_select($form_values) {
$rows = explode("\n", _webform_filtervalues($form_values['extra']['items'], FALSE));
foreach ($rows as $row) {
$row = trim($row);
if (preg_match('/^(.+)?\\|(.*)$/', $row, $matches)) {
if (preg_match('/ |"/', $matches[1])) {
form_set_error('field][extra][items', t('The options for this select contain illegal characters (quotes or spaces). Specify your options as <em>safe_value_no_spaces</em>|<em>The Real Value</em>.'));
return false;
}
}
}
return true;
}