PHP ldap_add function to escape ldap special characters in DN syntax

前端 未结 4 946
Happy的楠姐
Happy的楠姐 2020-12-30 05:20

I\'m trying to add some users to my Ldap DB but I get some errors (invalid dn syntax) when I use some special characters like \",.\". I need a function that escape all chara

4条回答
  •  猫巷女王i
    2020-12-30 06:01

    Those characters must escaped to be part of the data of a distinguished name or relative distinguished name. Escape the character (as in all LDAP) with a backslash 2 hex digit, such as \2a. Anything else would not be in compliance with the standards body documents. See RFC4514 for more specific information regarding the string representation of distinguished names.

提交回复
热议问题