summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/User_LDAP.php
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2016-09-23 01:30:57 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2016-10-13 00:53:34 +0200
commit011d5f554c1fcc2896c8798c9ef29b59af7b2692 (patch)
treea82d4724e97221a2cf05fb3e5c2c39fc8a462321 /apps/user_ldap/lib/User_LDAP.php
parent17fa45a29200ced15b4258f2d06d8159b60856f9 (diff)
downloadnextcloud-server-011d5f554c1fcc2896c8798c9ef29b59af7b2692.tar.gz
nextcloud-server-011d5f554c1fcc2896c8798c9ef29b59af7b2692.zip
Harden empty
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/User_LDAP.php')
-rw-r--r--apps/user_ldap/lib/User_LDAP.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index e7658149302..9f2468bcc85 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -385,7 +385,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
//Check whether the display name is configured to have a 2nd feature
$additionalAttribute = $this->access->connection->ldapUserDisplayName2;
$displayName2 = '';
- if(!empty($additionalAttribute)) {
+ if ($additionalAttribute !== '') {
$displayName2 = $this->access->readAttribute(
$this->access->username2dn($uid),
$additionalAttribute);
@@ -398,8 +398,8 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
if($displayName && (count($displayName) > 0)) {
$displayName = $displayName[0];
- if(is_array($displayName2) && (count($displayName2) > 0)) {
- $displayName2 = $displayName2[0];
+ if (is_array($displayName2)){
+ $displayName2 = count($displayName2) > 0 ? $displayName2[0] : '';
}
$user = $this->access->userManager->get($uid);