vobject icon indicating copy to clipboard operation
vobject copied to clipboard

Fix unescaping of URIs in VCard4 and mime type of images in converter

Open mstilkerich opened this issue 3 years ago • 2 comments

This PR fixes two issues encountered on a V4 VCard.

  1. RFC6350 allows escaping of semicolons in property values, but vobject did not unescape them in input. data URIs used for inline images in v4 VCard contain both semicolon and comma. When the semicolon is escaped (which is optional for the producer of the VCard), it must be unescaped by the consumer or the resulting URI will still contain the backslash and be malformed.
  2. Mime types are case insensitive (RFC2045). In the vcard converter in conversion from v4, the mime type is checked in a case sensitive manner and would thus fail to convert the mime type if it is not lowercase in the input. Changed the handling to treat this case-insensitive.

Tests adapted / extended accordingly.

mstilkerich avatar Dec 25 '22 08:12 mstilkerich

Codecov Report

Attention: Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.72%. Comparing base (7b17e07) to head (4d89b2e). Report is 112 commits behind head on master.

Files with missing lines Patch % Lines
lib/Property/Uri.php 90.00% 2 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #602      +/-   ##
============================================
+ Coverage     98.53%   98.72%   +0.19%     
- Complexity     1865     1869       +4     
============================================
  Files            71       71              
  Lines          4157     5336    +1179     
============================================
+ Hits           4096     5268    +1172     
- Misses           61       68       +7     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

codecov[bot] avatar Dec 25 '22 08:12 codecov[bot]

Added another fix: Remove X-ADDRESSBOOKSERVER-KIND=individual property in converting vcard v3 to v4. The existing test for this was broken because the used input did not contain the corresponding property.

mstilkerich avatar Dec 26 '22 09:12 mstilkerich