Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,16 @@ private function findNameAndEmail($aLdapItem, $aEmailFields, $aNameFields, $aUid
{
if (!empty($aLdapItem[$sField][0]))
{
$sName = \trim($aLdapItem[$sField][0]);
# The attribute is multi-valued
$value = $aLdapItem[$sField][0];
} else if ( defined($aLdapItem[$sField]) && is_string($aLdapItem[$sField]) )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined?

{
# The attribute is mono-valued
$value = $aLdapItem[$sField];
}
if (!empty($value))
{
$sName = \trim($value);
if (!empty($sName))
{
break;
Expand Down Expand Up @@ -234,6 +243,9 @@ private function ldapSearch($oAccount, $sQuery)
$aEmails = \array_map('trim', $aEmails);
$aNames = \array_map('trim', $aNames);
$aUIDs = \array_map('trim', $aUIDs);
$aEmails = \array_map('strtolower', $aEmails);
$aNames = \array_map('strtolower', $aNames);
$aUIDs = \array_map('strtolower', $aUIDs);

$aFields = \array_merge($aEmails, $aNames, $aUIDs);

Expand Down