Skip to content

Commit

Permalink
Bug: 14307 Fix syncing notes via EAS when no truncation value is sent.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Apr 2, 2016
1 parent 5237ed1 commit b200440
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions turba/lib/Driver.php
Expand Up @@ -2738,15 +2738,14 @@ public function toASContact(Turba_Object $object, array $options = array())
$note = new Horde_ActiveSync_Message_AirSyncBaseBody();
// No HTML supported in Turba's notes. Always use plaintext.
$note->type = Horde_ActiveSync::BODYPREF_TYPE_PLAIN;
if (isset($bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize'])) {
if (Horde_String::length($value) > $bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize']) {
if (isset($bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize']) &&
Horde_String::length($value) > $bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize']) {
$note->data = Horde_String::substr($value, 0, $bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize']);
$note->truncated = 1;
} else {
$note->data = $value;
}
$note->estimateddatasize = Horde_String::length($value);
} else {
$note->data = $value;
}
$note->estimateddatasize = Horde_String::length($value);
$message->airsyncbasebody = $note;
} elseif (strlen($value)) {
// EAS 2.5
Expand Down

0 comments on commit b200440

Please sign in to comment.