Merge pull request #21421 from nextcloud/fix/noid/cached-missing-dn

getXbyY can still return false, e.g. when using ldap write support
This commit is contained in:
blizzz 2020-06-19 20:01:06 +02:00 committed by GitHub
commit 976dbf6241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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)) !== false) {
$this->cache[$dn] = $name;
}
return $dn;