Skip to content

Commit ba76bc3

Browse files
committed
fix(LDAP): do not use count() inside a loop
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 7658f97 commit ba76bc3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/user_ldap/lib/User/User.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ public function processAttributes(array $ldapEntry): void {
130130
$attr = strtolower($this->connection->ldapEmailAttribute);
131131
if (isset($ldapEntry[$attr])) {
132132
$mailValue = 0;
133-
for ($x = 0; $x < count($ldapEntry[$attr]); $x++) {
133+
$emailValues = count($ldapEntry[$attr]);
134+
for ($x = 0; $x < $emailValues; $x++) {
134135
if (filter_var($ldapEntry[$attr][$x], FILTER_VALIDATE_EMAIL)) {
135136
$mailValue = $x;
136137
break;

0 commit comments

Comments
 (0)