Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate repair component should not deduplicate properties when properties must appear exactly once #615

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant