Skip to content

Commit 823aafd

Browse files
authored
trim UID and GID always (#278)
1 parent 11b2f01 commit 823aafd

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

resources/lib/UnityGroup.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class UnityGroup
3030
*/
3131
public function __construct($gid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK)
3232
{
33+
$gid = trim($gid);
3334
$this->gid = $gid;
3435
$this->entry = $LDAP->getPIGroupEntry($gid);
3536

resources/lib/UnityOrg.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class UnityOrg
1717

1818
public function __construct($gid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK)
1919
{
20+
$gid = trim($gid);
2021
$this->gid = $gid;
2122
$this->entry = $LDAP->getOrgGroupEntry($this->gid);
2223

resources/lib/UnityUser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class UnityUser
2121

2222
public function __construct($uid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK)
2323
{
24+
$uid = trim($uid);
2425
$this->uid = $uid;
2526
$this->entry = $LDAP->getUserEntry($uid);
2627

webroot/panel/groups.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
if (isset($_POST["form_type"])) {
1313
if (isset($_POST["pi"])) {
14-
$pi_account = new UnityGroup(trim($_POST["pi"]), $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK);
14+
$pi_account = new UnityGroup($_POST["pi"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK);
1515
if (!$pi_account->exists()) {
1616
// "\'" instead of "'", otherwise it will close a single quote used to place the message
1717
array_push($modalErrors, "This PI doesn\'t exist");

0 commit comments

Comments
 (0)