Summary | export vcard - escape of ; |
Queue | Turba |
Queue Version | 2.1.1 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | |
Requester | etiennesky (at) yahoo (dot) com |
Created | 06/23/2006 (6978 days ago) |
Due | |
Updated | 07/05/2006 (6966 days ago) |
Assigned | 06/23/2006 (6978 days ago) |
Resolved | 07/05/2006 (6966 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
version of horde.
What I did, though, is have a look at the code in the CVS version and
used that to fix the stable version. It seems to work, in that it
doesn't put superfluous \ but mozilla-thunderbird adress book has
problems importing a vcard file that escapes ; and \ with \; and \\
respectively.
So I think that the fix is OK, here is what I did:
-----
default:
// As of rfc 2426 2.4.2 semi-colon, comma, and colon
// must be escaped. Exclude MAILTO: though. This is a hack!
// $value = str_replace(array(';', ':', ',', 'MAILTO\\:'),
// array('\\;', '\\:', '\\,', 'MAILTO:'),
// $value);
if (is_array($attribute['values']) && count($attribute['values'])>1) {
$values = $attribute['values'];
if ($name == 'N' || $name == 'ADR') $glue = ';';
else $glue = ',';
$values = str_replace(array(';', ':', ',', 'MAILTO\\:'),
array('\\;', '\\:', '\\,', 'MAILTO:'),
$values);
$value = implode($glue, $values);
} else {
// As of rfc 2426 2.4.2 semicolon, comma, and colon
// must be escaped. Exclude MAILTO: though. This is a
// hack!
$value = str_replace(array(';', ':', ',', 'MAILTO\\:'),
array('\\;', '\\:', '\\,', 'MAILTO:'),
$value);
}
break;
-----
The 3 lines have been commented and replaced.
If you want a patch, I'll make one, but it will not be necessary to
fix the CVS version as it seems ok.
You need to have the ADR (adress) or N (Name) Field empty
State ⇒ Feedback
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ export vcard - escape of ;
Queue ⇒ Turba
State ⇒ Unconfirmed
are converted to "\;" where they should not be.
This happens in the "N" (name) and "ADR" (adress)
fields, when the values are empty.
As an example, here is part of one entry:
-----
N:Aerotechnik\;\;\;\;
ADR;TYPE=HOME:\;\;\;\;\;\;
ADR;TYPE=WORK:\;\;\;\;\;\;
-----
but it should read:
-----
N:Aerotechnik;;;;
ADR;TYPE=HOME:;;;;;;
ADR;TYPE=WORK:;;;;;;
-----
The problem is that is escapes ";" even when it is used
as a field seperator.
The code is in horde/lib/Horde/iCalendar.php in
function _exportvData on line 790.