mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-10 01:47:03 +03:00
Bugfix: Contacts management failed
It had a strange array type structure and buggy
This commit is contained in:
parent
0e3275599e
commit
3a315bc543
7 changed files with 44 additions and 40 deletions
|
|
@ -144,12 +144,15 @@ trait Contacts
|
|||
{
|
||||
foreach ($aProperties as $aItem)
|
||||
{
|
||||
if ($aItem && isset($aItem[0], $aItem[1]) && \is_numeric($aItem[0]))
|
||||
if ($aItem && isset($aItem['type'], $aItem['value'])
|
||||
&& \is_numeric($aItem['type']) && (int) $aItem['type']
|
||||
&& \RainLoop\Providers\AddressBook\Enumerations\PropertyType::FULLNAME != $aItem['type']
|
||||
&& \strlen(\trim($aItem['value'])))
|
||||
{
|
||||
$oProp = new \RainLoop\Providers\AddressBook\Classes\Property();
|
||||
$oProp->Type = (int) $aItem[0];
|
||||
$oProp->Value = $aItem[1];
|
||||
$oProp->TypeStr = empty($aItem[2]) ? '': $aItem[2];
|
||||
$oProp->Type = (int) $aItem['type'];
|
||||
$oProp->Value = \trim($aItem['value']);
|
||||
$oProp->TypeStr = $aItem['typeStr'] ?? '';
|
||||
|
||||
$oContact->Properties[] = $oProp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -645,6 +645,7 @@ class Contact implements \JsonSerializable
|
|||
}
|
||||
return array(
|
||||
'@Object' => 'Object/Contact',
|
||||
'id' => $this->IdContact,
|
||||
'display' => \MailSo\Base\Utils::Utf8Clear($this->Display),
|
||||
'readOnly' => $this->ReadOnly,
|
||||
'IdPropertyFromSearch' => $this->IdPropertyFromSearch,
|
||||
|
|
|
|||
|
|
@ -159,6 +159,6 @@ class Property implements \JsonSerializable
|
|||
'type' => $this->Type,
|
||||
'typeStr' => $this->TypeStr,
|
||||
'value' => \MailSo\Base\Utils::Utf8Clear($this->Value)
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue