Fix: Escape group names for LDAP

Groups may contain special characters (Like "(" or ")") that should be escaped to ensure geenrted queries are correct.

Signed-off-by: AaronDewes <aaron.dewes@protonmail.com>
This commit is contained in:
AaronDewes 2023-03-13 18:58:59 +00:00 committed by Aaron Dewes
parent 51a73d8e80
commit c42d9d439a

View file

@ -973,7 +973,7 @@ class Wizard extends LDAPUtility {
if (is_array($cns) && count($cns) > 0) {
$filter .= '(|';
foreach ($cns as $cn) {
$filter .= '(cn=' . $cn . ')';
$filter .= '(cn=' . ldap_escape($cn, '', LDAP_ESCAPE_FILTER) . ')';
}
$filter .= ')';
}