Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing vCards adds additional quotation marks in TYPE atributes #532

Closed
5ila5 opened this issue Sep 14, 2022 · 3 comments
Closed

Parsing vCards adds additional quotation marks in TYPE atributes #532

5ila5 opened this issue Sep 14, 2022 · 3 comments

Comments

@5ila5
Copy link

5ila5 commented Sep 14, 2022

var vCard = "BEGIN:VCARD\nVERSION:3.0\nPRODID:-//Apple Inc.//iOS 13.3//EN\nN:Doe;John;;;\nFN:John Doe\nEMAIL;type=INTERNET;type=HOME;type=pref:John_Doer@example.com\nTEL;type=CELL;type=VOICE;type=pref:+49 123 4567890\nitem1.ADR;type=HOME;type=pref:;;street 2A;MyCity;MyState;83465;Deutschl\n and\nBDAY;value=date:1900-01-01\nREV:2020-01-17T10:34:14Z\nX-IMAGEHASH:qYML1ZJqQnL6FyrmNWNsWw==\nEND:VCARD"


var jcalData = ICAL.parse(vCard);
vCard = new ICAL.Component(jcalData)
console.log(vCard.toString())

returns

BEGIN:VCARD
VERSION:3.0
PRODID;VALUE=TEXT:-//Apple Inc.//iOS 13.3//EN
N:Doe;John;;;
FN:John Doe
EMAIL;TYPE="INTERNET,HOME,pref":John_Doer@example.com
TEL;TYPE="CELL,VOICE,pref";VALUE=PHONE-NUMBER:+49 123 4567890
ITEM1.ADR;TYPE="HOME,pref":;;street 2A;MyCity;MyState;83465;Deutschland
BDAY;VALUE=DATE:19000101
REV;VALUE=DATE-TIME:20200117T103414Z
X-IMAGEHASH:qYML1ZJqQnL6FyrmNWNsWw==
END:VCARD

Which has quotation marks for the Type parameter of EMAIL an TEL
I encountered this because i wanted to diagnose an error with Nextcloud where CardDav would display additional quotation marks
nextcloud/server#25485
nextcloud/contacts#2866

I had this issue only when importing where this library is Used:
https://github.com/nextcloud/contacts/blob/5fd5d688d93d65b1079906e92eb31da65917b98d/src/models/contact.js#L61-L72

Edited:
the above code is called in followed by
vCard.toString()
https://github.com/nextcloud/contacts/blob/5fd5d688d93d65b1079906e92eb31da65917b98d/src/store/addressbooks.js#L410-L424

@darktrojan
Copy link
Collaborator

@kewisch Does this make sense?

AFAICT, properties that need every value quoted have URI values and therefore get quoted because of the :, and properties that don't the only possible values are simple strings (cell, voice, internet) etc. and wouldn't get quoted. Is there some case I'm missing?

@kewisch
Copy link
Owner

kewisch commented May 1, 2024

@darktrojan Can we close this given #555 is merged?

@kewisch kewisch added the needinfo More information has been requested label May 1, 2024
Copy link

github-actions bot commented Jun 1, 2024

It looks like we haven't heard back on this issue, therefore we are closing this issue. If this problem persists in the latest version of ical.js, please re-open this issue.

@github-actions github-actions bot closed this as completed Jun 1, 2024
@github-actions github-actions bot removed the needinfo More information has been requested label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants