Skip to content

Commit 4c8f324

Browse files
authored
escape inputs
1 parent d1c4f66 commit 4c8f324

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: resources/lib/UnityLDAP.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -315,25 +315,25 @@ public function getAllOrgGroups($UnitySQL, $UnityMailer, $UnityRedis, $UnityWebh
315315

316316
public function getUserEntry($uid)
317317
{
318-
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$uid," . $this->STR_USEROU);
318+
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=" . ldap_escape($uid, LDAP_ESCAPE_DN) . "," . $this->STR_USEROU);
319319
return $ldap_entry;
320320
}
321321

322322
public function getGroupEntry($gid)
323323
{
324-
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$gid," . $this->STR_GROUPOU);
324+
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=" . ldap_escape($gid, LDAP_ESCAPE_DN) . "," . $this->STR_GROUPOU);
325325
return $ldap_entry;
326326
}
327327

328328
public function getPIGroupEntry($gid)
329329
{
330-
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$gid," . $this->STR_PIGROUPOU);
330+
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=" . ldap_escape($gid, LDAP_ESCAPE_DN) . "," . $this->STR_PIGROUPOU);
331331
return $ldap_entry;
332332
}
333333

334334
public function getOrgGroupEntry($gid)
335335
{
336-
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=$gid," . $this->STR_ORGGROUPOU);
336+
$ldap_entry = new LDAPEntry($this->getConn(), unityLDAP::RDN . "=" . ldap_escape($gid, LDAP_ESCAPE_DN) . "," . $this->STR_ORGGROUPOU);
337337
return $ldap_entry;
338338
}
339339
}

0 commit comments

Comments
 (0)