function _webform_safe_name in Webform 5
Same name and namespace in other branches
- 5.2 webform.module \_webform_safe_name()
- 6.3 webform.module \_webform_safe_name()
- 6.2 webform.module \_webform_safe_name()
- 7.4 webform.module \_webform_safe_name()
- 7.3 webform.module \_webform_safe_name()
3 calls to _webform_safe_name()
- _webform_render_select in components/
select.inc - Build a form item array containing all the properties of this component.
- _webform_submission_display_grid in components/
grid.inc - Display the result of a grid submission. The output of this function will be displayed under the "results" tab then "submissions"
- _webform_submission_display_select in components/
select.inc - Display the result of a textfield submission. The output of this function will be displayed under the "results" tab then "submissions".
File
- ./
webform.module, line 1858
Code
function _webform_safe_name($name) {
$new = drupal_strtolower(trim($name));
$new = str_replace(' ', '_', $new);
$new = preg_replace('/[^a-z0-9_]/', '', $new);
// If the string contains NO safe characters, base64 encode the answer.
if ($new == '') {
$new = base64_encode($name);
}
return $new;
}