View Issue Details

IDProjectCategoryView StatusLast Update
0002205SOGoBackend Address Bookpublic2016-12-09 20:02
Reportertfl Assigned Toludovic  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionwon't fix 
Product Version2.0.4 
Summary0002205: special chars in vcards are html encoded with html entities &#xxx;
Description

If I read using curl or wget a vcard and the card contains special chars somewhere (for instance german umlauts) the data will be encoded using html entities &#xxx; This is bad behavior because the semicolon is defined as part of the vcard specification. This makes it really hard to parse.

Why not just return plain UTF-8 like the answer from the (even your own) server indicates:
Response: content-type: text/xml; charset="utf-8"
Data:
<?xml version="1.0" encoding="utf-8"?>
...
BEGIN:VCARD
...
END:VCARD

TagsNo tags attached.

Activities

francis

francis

2013-01-30 14:09

administrator   ~0005277

I can't reproduce this bug. How have you created/modified your card? From the Web interface or a fat client?

tfl

tfl

2013-01-30 14:46

reporter   ~0005281

Last edited: 2013-01-30 14:52

I did nothing with the card(s) whatsoever. I'm writing a program to search and display contacts for the mutt mail client. To this I use libcurl.

Using curl one can get the data from a carddav service like this:
1) create a xml query file

<?xml version="1.0" encoding="utf-8" ?>
<C:addressbook-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
<D:prop>
<D:getetag/>
<C:address-data>
<C:prop name="EMAIL"/>
<C:prop name="FN"/>
</C:address-data>
</D:prop>
<C:filter test="anyof">
<C:prop-filter name="FN">
<C:text-match collation="i;unicode-casemap"
match-type="contains">QUERY-TERM</C:text-match>
</C:prop-filter>
<C:prop-filter name="EMAIL">
<C:text-match collation="i;unicode-casemap"
match-type="contains">QUERY-TERM</C:text-match>
</C:prop-filter>
</C:filter>
</C:addressbook-query>

Now lets curl for the cards containing your QUERY-TERM in FN and/or EMAIL:
$ curl -v -i -X REPORT -H 'Content-Type: text/xml; charset=utf-8'
-u 'user:pass' -d @query.xml <SOGo-Contacts-URL>

If a records contains a german umlaut (ä for instance) it will become &#<NUMBER>; - i.e. FN:Max;Musterm&#<NUMBER>;nn

Both my ARCH-linux system and libcurl are up-to-date. I use de_DE.UTF-8 as locale.

tfl

tfl

2013-01-30 14:48

reporter   ~0005282

Last edited: 2013-01-30 22:06

Ahh I see - I can't enter html entities... I will make a screen shot

  • Screenshot uploaded

2013-01-30 22:01

 

vcard.png (15,764 bytes)   
vcard.png (15,764 bytes)   
tfl

tfl

2013-01-30 22:05

reporter   ~0005289

Last edited: 2013-01-30 22:06

another question came to my mind: why is the server answering twice?

first) a vcard within <C:address-data>
second) the same vcard within <C:addressbook-data>

see screenshot.

francis

francis

2013-01-31 16:59

administrator   ~0005296

From the web interface, show us the raw source of the problematic vcard (select "Show raw source" from the contextual menu).

tfl

tfl

2013-01-31 17:05

reporter   ~0005297

the source is valid:

BEGIN:VCARD
UID:5136-51080900-9-68BA3880.vcf
VERSION:3.0
CLASS:PUBLIC
PROFILE:VCARD
N:Rabarber;Fränzchen
FN:Fränzchen Rabarber
EMAIL;TYPE=work:franz@rabarber.com
END:VCARD

ludovic

ludovic

2016-12-09 20:02

administrator   ~0010979

RFC6352 says:

Note: The address data embedded within the CARDDAV:address-data XML
element MUST follow the standard XML character data encoding
rules, including use of <, >, & etc., entity encoding or
the use of a <![CDATA[ ... ]]> construct. In the latter case, the
vCard data cannot contain the character sequence "]]>", which is
the end delimiter for the CDATA section.

SOGo returns the data following the XML data encoding rules. If we decide or not to encode entities, it doesn't matter - it just takes a bit more bytes at the end. On the other end, a CardDAV client MUST decode (following the XML data de/encoding rules) the received address-data BEFORE parsing it as a vCard object.

Issue History

Date Modified Username Field Change
2013-01-29 18:14 tfl New Issue
2013-01-30 14:09 francis Note Added: 0005277
2013-01-30 14:46 tfl Note Added: 0005281
2013-01-30 14:48 tfl Note Added: 0005282
2013-01-30 14:48 tfl Note Edited: 0005281
2013-01-30 14:49 tfl Note Edited: 0005281
2013-01-30 14:50 tfl Note Edited: 0005281
2013-01-30 14:50 tfl Note Edited: 0005282
2013-01-30 14:52 tfl Note Edited: 0005281
2013-01-30 22:01 tfl File Added: vcard.png
2013-01-30 22:05 tfl Note Added: 0005289
2013-01-30 22:06 tfl Note Edited: 0005289
2013-01-30 22:06 tfl Note Edited: 0005282
2013-01-31 16:59 francis Note Added: 0005296
2013-01-31 17:05 tfl Note Added: 0005297
2016-12-09 16:20 ludovic Assigned To => ludovic
2016-12-09 16:20 ludovic Status new => assigned
2016-12-09 20:02 ludovic Note Added: 0010979
2016-12-09 20:02 ludovic Status assigned => closed
2016-12-09 20:02 ludovic Resolution open => won't fix