[Tickets #4076] export vcard - escape of ;

bugs@bugs.horde.org bugs at bugs.horde.org
Thu Jun 29 13:50:04 PDT 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4076
-----------------------------------------------------------------------
 Ticket             | 4076
 Updated By         | etiennesky at yahoo.com
 Summary            | export vcard - escape of ;
 Queue              | Turba
 Version            | 2.1.1
 State              | Feedback
 Priority           | 2. Medium
 Type               | Bug
 Owners             | 
-----------------------------------------------------------------------


etiennesky at yahoo.com (2006-06-29 13:50) wrote:

I'm sorry, but I don't have the time presently to install a CVS 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.





More information about the bugs mailing list