Loading src/main/java/at/bitfire/vcard4android/Contact.kt +7 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,13 @@ class Contact { c.uid = UUID.randomUUID().toString() } // remove properties which // - couldn't be parsed (and thus are treated as extended/unknown properties), and // - must occur once max. arrayOf("ANNIVERSARY", "BDAY", "KIND", "N", "PRODID", "REV", "UID").forEach { vCard.removeExtendedProperty(it) } // store all remaining properties into unknownProperties if (vCard.properties.isNotEmpty() || vCard.extendedProperties.isNotEmpty()) try { Loading src/test/java/at/bitfire/vcard4android/ContactTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,12 @@ class ContactTest { assertEquals("My Phone", c.phoneNumbers.first.label) } @Test fun testInvalidREV() { val c = parseContact("invalid-rev.vcf") assertFalse(c.unknownProperties!!.contains("REV")) } @Test fun testVCard3FieldsAsVCard3() { Loading src/test/resources/invalid-rev.vcf 0 → 100644 +21 −0 Original line number Diff line number Diff line BEGIN:VCARD VERSION:4.0 PRODID:+//IDN bitfire.at//DAVdroid/1.11.4.1-ose ez-vcard/0.10.4 X-EVOLUTION-FILE-AS:Xxxxxx-xxxx\, Loïc X-EVOLUTION-MANAGER: X-EVOLUTION-ASSISTANT: X-EVOLUTION-SPOUSE: X-EVOLUTION-BLOG-URL: X-EVOLUTION-VIDEO-URL: X-MOZILLA-HTML:FALSE REV;VALUE=timestamp:2018-04-30T07:42:25Z(1) CALURI: FBURL: UID:pas-id-0c6bbc36b403f6e885c75e4835f796bba6fcdc12 FN:Loïc Xxxxxx-xxxx N:Xxxxxx-xxxx;Loïc;;; ORG:xxxxxxxmail EMAIL;TYPE=work:loic.Xxxxxx-xxxx@xxxxxxxmail.com URL: REV:20180619T131622Z END:VCARD Loading
src/main/java/at/bitfire/vcard4android/Contact.kt +7 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,13 @@ class Contact { c.uid = UUID.randomUUID().toString() } // remove properties which // - couldn't be parsed (and thus are treated as extended/unknown properties), and // - must occur once max. arrayOf("ANNIVERSARY", "BDAY", "KIND", "N", "PRODID", "REV", "UID").forEach { vCard.removeExtendedProperty(it) } // store all remaining properties into unknownProperties if (vCard.properties.isNotEmpty() || vCard.extendedProperties.isNotEmpty()) try { Loading
src/test/java/at/bitfire/vcard4android/ContactTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,12 @@ class ContactTest { assertEquals("My Phone", c.phoneNumbers.first.label) } @Test fun testInvalidREV() { val c = parseContact("invalid-rev.vcf") assertFalse(c.unknownProperties!!.contains("REV")) } @Test fun testVCard3FieldsAsVCard3() { Loading
src/test/resources/invalid-rev.vcf 0 → 100644 +21 −0 Original line number Diff line number Diff line BEGIN:VCARD VERSION:4.0 PRODID:+//IDN bitfire.at//DAVdroid/1.11.4.1-ose ez-vcard/0.10.4 X-EVOLUTION-FILE-AS:Xxxxxx-xxxx\, Loïc X-EVOLUTION-MANAGER: X-EVOLUTION-ASSISTANT: X-EVOLUTION-SPOUSE: X-EVOLUTION-BLOG-URL: X-EVOLUTION-VIDEO-URL: X-MOZILLA-HTML:FALSE REV;VALUE=timestamp:2018-04-30T07:42:25Z(1) CALURI: FBURL: UID:pas-id-0c6bbc36b403f6e885c75e4835f796bba6fcdc12 FN:Loïc Xxxxxx-xxxx N:Xxxxxx-xxxx;Loïc;;; ORG:xxxxxxxmail EMAIL;TYPE=work:loic.Xxxxxx-xxxx@xxxxxxxmail.com URL: REV:20180619T131622Z END:VCARD