View Issue Details

IDProjectCategoryView StatusLast Update
0001343SOGo Connectorwith external serverpublic2011-06-21 21:09
Reporterdanielmayer Assigned Towsourdeau 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.105 
Fixed in Version3.106 
Summary0001343: Sogo Connector sends invalid BDAY field in VCARD (for Apple/Darwin calendarserver)
Description

Hi,

it seems the sogo connector for thunderbird does not format the BDAY
field in VCARDS correctly. The month and day numbers are not being
padded with leading zeros resulting in entries such as:

BDAY:1980-1-2

which should read:

BDAY:1980-01-02

This can easily be fixed in vcards.utils.js (see patch below). I just
added a generic function to pad a number with leading zeros. This is
obviously not the best place to put the padding function but it allowed
for a succinct patch.

Additional Information

Patch:
*** vcards.utils.js.3.105 2011-06-21 13:46:01.000000000 -0400
--- vcards.utils.js 2011-06-21 13:39:39.000000000 -0400


* 741,749 **
if (jobTitle.length)
vCard += foldedLine("TITLE:" + jobTitle) + "\r\n";

  let birthYear = card.getProperty("BirthYear", 0);

! let birthMonth = card.getProperty("BirthMonth", 0);
! let birthDay = card.getProperty("BirthDay", 0);
if (birthYear && birthMonth && birthDay)
vCard += foldedLine("BDAY:" + escapedForCard(birthYear)

  • "-" + escapedForCard(birthMonth)
    --- 741,756 ----
    if (jobTitle.length)
    vCard += foldedLine("TITLE:" + jobTitle) + "\r\n";
  • function pad(num,count) {
  • var padNum = num + '';
  • while(padNum.length < count) {
  • padNum = "0" + padNum;
  • }
  • return padNum;
  • }
    let birthYear = card.getProperty("BirthYear", 0);
    ! let birthMonth = pad(card.getProperty("BirthMonth", 0),2);
    ! let birthDay = pad(card.getProperty("BirthDay", 0),2);
    if (birthYear && birthMonth && birthDay)
    vCard += foldedLine("BDAY:" + escapedForCard(birthYear)
    • "-" + escapedForCard(birthMonth)
TagsNo tags attached.

Activities

danielmayer

danielmayer

2011-06-21 19:24

reporter   ~0002616

I should add that the invalid field causes the VCARD to be rejected by the server.

wsourdeau

wsourdeau

2011-06-21 21:09

viewer   ~0002617

Fixed in 14081480a6d3ce8a239678733bed153ca9d5a435

Thanks!

Issue History

Date Modified Username Field Change
2011-06-21 19:23 danielmayer New Issue
2011-06-21 19:24 danielmayer Note Added: 0002616
2011-06-21 21:09 wsourdeau Note Added: 0002617
2011-06-21 21:09 wsourdeau Status new => resolved
2011-06-21 21:09 wsourdeau Fixed in Version => 3.106
2011-06-21 21:09 wsourdeau Resolution open => fixed
2011-06-21 21:09 wsourdeau Assigned To => wsourdeau