Ticket #1485502 (closed Bugs: fixed)
vcard import errors (example from PINE)
| Reported by: | jeblair | Owned by: | thomasb |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.2-stable |
| Component: | PHP backend | Version: | 0.2-beta |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Now that there is an import function, the vcard parser can be improved to accept variances in the vcard data supplied.
This patch addresses two things:
1) The EMAIL field doesn't require TYPE parameters, it can simply be EMAIL:foo@example.com. However RC's vcard parser assumes there will be type attributes. The first part of the patch corrects that.
2) The N field is required to have 5 parts, unfortunately PINE will sometimes emit a field without any semicolons in it's export. RC actually fails with a PHP error in this case. In the spirit of being generous with accepting data on the internet, RC should gracefully handle this case. The second part of the patch adds a line to the cleanup code (only run during an import) to add semicolons to N if none exist.
Here is an example VCARD export from PINE:
BEGIN:VCARD VERSION:3.0 NICKNAME:nick EMAIL:foo@example.com NOTE:a note FN:<Unknown> N:<Unknown> END:VCARD
