summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Access.php
diff options
context:
space:
mode:
authorJuan Pablo Villafáñez <jvillafanez@solidgear.es>2016-10-04 18:12:48 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2016-12-05 11:29:47 +0100
commitefa10778720a853843cf66355d958f2d84ca6c3e (patch)
treec22ae4f27017a1fe2d0e0cf54de746356b2b8b71 /apps/user_ldap/lib/Access.php
parent6496b95564828726eaed87ab15141846d3da0287 (diff)
downloadnextcloud-server-efa10778720a853843cf66355d958f2d84ca6c3e.tar.gz
nextcloud-server-efa10778720a853843cf66355d958f2d84ca6c3e.zip
Extract lowercase conversion out of the loop
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/Access.php')
-rw-r--r--apps/user_ldap/lib/Access.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 7f5bc028b6b..1a9c04aef77 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -280,10 +280,11 @@ class Access extends LDAPUtility implements IUserTools {
public function extractAttributeValuesFromResult($result, $attribute) {
$values = [];
if(isset($result[$attribute]) && $result[$attribute]['count'] > 0) {
+ $lowercaseAttribute = strtolower($attribute);
for($i=0;$i<$result[$attribute]['count'];$i++) {
if($this->resemblesDN($attribute)) {
$values[] = $this->sanitizeDN($result[$attribute][$i]);
- } elseif(strtolower($attribute) === 'objectguid' || strtolower($attribute) === 'guid') {
+ } elseif($lowercaseAttribute === 'objectguid' || $lowercaseAttribute === 'guid') {
$values[] = $this->convertObjectGUID2Str($result[$attribute][$i]);
} else {
$values[] = $result[$attribute][$i];