From 793b6383db3d91f1befb90d16f5922540b6750fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 25 Jul 2016 09:46:19 +0200 Subject: [PATCH] [stable9.1] Fix undefined OfflineUser::composeAndStoreDisplayName() - fixes #23248 --- apps/user_ldap/lib/User_LDAP.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index 7929394893b2..7d48bdd23ed4 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -382,8 +382,14 @@ public function getDisplayName($uid) { } $user = $this->access->userManager->get($uid); - $displayName = $user->composeAndStoreDisplayName($displayName, $displayName2); - $this->access->connection->writeToCache($cacheKey, $displayName); + if ($user instanceof User) { + $displayName = $user->composeAndStoreDisplayName($displayName, $displayName2); + $this->access->connection->writeToCache($cacheKey, $displayName); + } + if ($user instanceof OfflineUser) { + /** @var OfflineUser $user*/ + $displayName = $user->getDisplayName(); + } return $displayName; }