From 6f49974851b035736df78ecc5efed3bd162127ae Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 15 Jun 2020 21:48:27 +0200 Subject: [PATCH] getXbyY can still return false, e.g. when using ldap write support Signed-off-by: Arthur Schiwon --- apps/user_ldap/lib/Mapping/AbstractMapping.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index 6fd07f5f48..a4a3705e22 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -123,8 +123,7 @@ abstract class AbstractMapping { */ public function getDNByName($name) { $dn = array_search($name, $this->cache); - if ($dn === false) { - $dn = $this->getXbyY('ldap_dn', 'owncloud_name', $name); + if ($dn === false && $dn = $this->getXbyY('ldap_dn', 'owncloud_name', $name)) { $this->cache[$dn] = $name; } return $dn;