encodeForDN

Encodes the given string for safe output in LDAP Distinguished Names (DN). Intended to prevent LDAP Injection.

encodeForDN( string ); → returns string

encodeForDN Argument Reference

string string
Required

string to encode.

Links more information about encodeForDN

Examples sample code invoking the encodeForDN function

encodeForDN("x,y")

Expected Result: x\,y


Fork me on GitHub