-
Notifications
You must be signed in to change notification settings - Fork 3
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
VCardRawWriter: Conditionally allow invalid groups. #3
Conversation
So ezvcard will read these groups in, but refuse to write them back out? I put in a6e1f87 already, maybe it just needs extending to the write-side. |
I think it needs extension to groups handling; I'll do that then. |
Oh, upstream has dealt with this too https://github.com/mangstadt/ez-vcard/wiki/Changelog
|
This example has a newline character. |
Actually, if the writer doesn't violate the standard and escape newlines in group names, we probably need to stick with throwing them away rather than trying to write them back out. I feel like we're not losing much since clearly something's gone horribly wrong by that point anyway. |
The relevant portion is in the description. (The vcard parser does turn that |
Wow, icloud really does accept that wholesale. I suppose we could match their behavior and not unescape the newlines in group names, but I guess I'd be fine with blindly dropping them as well. the spec only seems to mention \n,\N in one place:
https://www.ietf.org/rfc/rfc2426.txt but it does seem like icloud is in the wrong here. |
Something (possibly Busy Contacts) added the following properties to an iCloud vcard, which iCloud happily accepts, and EZ-VCard actually parses: ``` COM \NWWW.COLPATRIA.COM <HTTP://www.colpatria.com>\n COM\NWWW.COLPATRIA.COM <HTTP://www.colpatria.com>\n\n\n\n ``` This extends the `propertyValidationEnabled` option to also disable validation of group names, on the assumption that if something got into iCloud or some other service, that service also will accept the same thing back. (And if we were able to parse it, it obviously doesn't break the syntax outright.)
6ce4139
to
46fb5e8
Compare
@blendmaster Revised to do this the same way as invalid properties. |
lgtm. |
Actually, this won't really work as-is because it doesn't re-escape the groups when writing. It would probably be a better solution to not interpret the escapes on read instead. |
Supercedes #3, since this actually can work.
Closing in favour of #4 |
Supercedes #3, since this actually can work.
Supercedes #3, since this actually can work.
Something (possibly Busy Contacts) added the following properties to an
iCloud vcard, which iCloud happily accepts, and EZ-VCard actually
parses:
Since it would be kind of awkward for us to manually go through and
validate groups, instead just silently discard groups which aren't
valid. This is kind of unfortunate, but I wasn't sure how better to
avoid this completely failing.
@blendmaster @skazhy Open for suggestions