Skip to content

Conversation

@cedtaz
Copy link

@cedtaz cedtaz commented Apr 3, 2023

The validate function with repair mode add automatically a property when the property must appear exactly once... like UID in VEVENT or VCARD.

A VCARD like this (with 2 UID for example) :

BEGIN:VCARD
VERSION:3.0
UID:a73404dd-7534-4151-a949-49711bef8422
UID:sabre-vobject-39afbdfc-47cf-489e-a1a3-6a8e6cc6b4f6
FN:Paul Martin
N:Martin;Paul;;;
END:VCARD

After a validate in repair mode, this VCARD looks like :

BEGIN:VCARD
VERSION:3.0
UID:a73404dd-7534-4151-a949-49711bef8422
UID:sabre-vobject-39afbdfc-47cf-489e-a1a3-6a8e6cc6b4f6
UID:sabre-vobject-101f5d63-572f-44c6-90e5-ef6cb4bf385d
...
FN:Paul Martin
N:Martin;Paul;;;
END:VCARD

This can be very problematic. The test is not strict enough :
1 !== $propertyCounters[$propName]

So we need to remove the old parameters when the number of properties is greater than 1. In fact, UID is a property which must appear exactly once.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant