private function LdapUserAdminForm::sanitizeMachineName in Lightweight Directory Access Protocol (LDAP) 8.3
Returns a config compatible machine name.
Parameters
string $string: Field name to process.
Return value
string Returns safe string.
2 calls to LdapUserAdminForm::sanitizeMachineName()
- LdapUserAdminForm::getServerMappingFields in ldap_user/
src/ Form/ LdapUserAdminForm.php - Return the server mappings for the fields.
- LdapUserAdminForm::syncMappingsFromForm in ldap_user/
src/ Form/ LdapUserAdminForm.php - Extract sync mappings array from mapping table in admin form.
File
- ldap_user/
src/ Form/ LdapUserAdminForm.php, line 1041
Class
- LdapUserAdminForm
- Provides the form to configure user configuration and field mapping.
Namespace
Drupal\ldap_user\FormCode
private function sanitizeMachineName($string) {
// Replace dots
// Replace square brackets.
return str_replace([
'.',
'[',
']',
], [
'-',
'',
'',
], $string);
}