Skip to content

DN should be escaped in DirectoryService::getMemberOf #22

@nixahnung

Description

@nixahnung

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; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions