-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fails to parse COMMA-separated list of calendar addresses in quoted-strings (e.g. MEMBER
parameter)
#634
Comments
@st3iny I'm unable to reproduce the issue. Here is my script:
Here is the result of one attendee:
|
Thanks for investigating further. It seems to break only if the Take a look at the following example:const ICAL = require('ical.js');
var iCalendarData = [
'ATTENDEE;MEMBER="mailto:mygroup@localhost","mailto:mygroup2@localhost","mailto:mygroup3@localhost";CN=user1;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE;LANGUAGE=en;SCHEDULE-STATUS=1.1:mailto:user1@localhost',
'ATTENDEE;MEMBER="mailto:mygroup@localhost","mailto:mygroup2@localhost","mailto:mygroup3@localhost":mailto:user2@localhost',
]
for (const attendeeIcs of iCalendarData) {
const attendee = ICAL.Property.fromString(attendeeIcs);
console.log('expected:', attendeeIcs)
console.log('actual: ', attendee.toICALString())
console.log('equal? ', attendee.toICALString() === attendeeIcs)
console.log('--------------------------------------------------')
} It will yield:
|
@dilyanpalauzov this seems like it is right up your alley with the escaping and parameter parsing fixes, would you be willing to take a look? |
test.only('with quoted multi-value parameter', function() {
let attendee = ICAL.Property.fromString(
'ATTENDEE;MEMBER=' +
'"mailto:mygroup@localhost",' +
'"mailto:mygroup2@localhost",' +
'"mailto:mygroup3@localhost":' +
'mailto:user2@localhost'
);
let expected = [
'attendee',
{
member: [
'mailto:mygroup@localhost',
'mailto:mygroup2@localhost',
'mailto:mygroup3@localhost'
]
},
'cal-address',
'mailto:user2@localhost'
]
assert.deepEqual(attendee.toJSON(), expected);
}); |
I was using ical.js back in 2020-2022. Now my focus moved to different things. I am glad that some of the changes, proposed by me at that time, were integrated today. As I have seen no progress with PRs, I have stopped creating new ones. My changes are visible at https://github.com/dilyanpalauzov/ical.js/commits/main/ . I think actually, there is only one change I have not uploaded: recur_expansion: EXDATE can be DATE and DTSTART can be DATE-TIME. That said, I am not willing to take a look. The last example above : |
Thanks, I've updated the test case. Hoping to show that I'm more active on this repo now so it is worth putting some new effort into this :) |
Bug still present in 2.0.1, going to look into a fix for this but not sure if I can manage 😅 |
RFC: https://www.rfc-editor.org/rfc/rfc5545#section-3.2.11
The builtin ics parser does not handle parsing COMMA-separated list of calendar addresses in quoted-strings correctly.
Note: The ics example data (attendee property) is valid and was copied as is from the RFC.
Example
Expected
Received
The parser stops at the colon inside the first quoted-string
MEMBER
parameter. But for some reason both member parameters are still parsed correctly. Only the property value is not parsed correctly.The text was updated successfully, but these errors were encountered: