Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DN should be escaped in DirectoryService::getMemberOf #22

Open
nixahnung opened this issue Apr 3, 2018 · 0 comments
Open

DN should be escaped in DirectoryService::getMemberOf #22

nixahnung opened this issue Apr 3, 2018 · 0 comments

Comments

@nixahnung
Copy link

nixahnung commented Apr 3, 2018

Problem: If an DN had some escaped special Characters in the value (at my scenario it is a comma), then getMemberOf Method crashed with "wrong Credentials".

Added this Method (copied from moodle-code).
/** * Quote control characters in texts used in LDAP filters - see RFC 4515/2254 * * @param string filter string to quote * @return string the filter string quoted */ protected function ldap_filter_addslashes($text) { $text = str_replace('\\', '\\5c', $text); $text = str_replace(array('*', '(', ')', "\0"), array('\\2a', '\\28', '\\29', '\\00'), $text); return $text; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant