diff --git a/lib/ical/parse.js b/lib/ical/parse.js index 8d40636b..be894aa6 100644 --- a/lib/ical/parse.js +++ b/lib/ical/parse.js @@ -349,7 +349,7 @@ ICAL.parse = (function() { // then increment pos to find next ; while ((pos !== false) && - (pos = helpers.unescapedIndexOf(line, delim, pos + 1)) !== -1) { + (pos = line.indexOf(delim, pos + 1)) !== -1) { name = line.substr(lastParam + 1, pos - lastParam - 1); if (name.length == 0) { @@ -375,12 +375,12 @@ ICAL.parse = (function() { var nextChar = line[pos + 1]; if (nextChar === '"') { valuePos = pos + 2; - pos = helpers.unescapedIndexOf(line, '"', valuePos); + pos = line.indexOf('"', valuePos); if (multiValue && pos != -1) { var extendedValue = true; while (extendedValue) { if (line[pos + 1] == multiValue && line[pos + 2] == '"') { - pos = helpers.unescapedIndexOf(line, '"', pos + 3); + pos = line.indexOf('"', pos + 3); } else { extendedValue = false; } @@ -392,7 +392,7 @@ ICAL.parse = (function() { ); } value = line.substr(valuePos, pos - valuePos); - lastParam = helpers.unescapedIndexOf(line, PARAM_DELIMITER, pos); + lastParam = line.indexOf(PARAM_DELIMITER, pos); if (lastParam === -1) { pos = false; } @@ -400,8 +400,8 @@ ICAL.parse = (function() { valuePos = pos + 1; // move to next ";" - var nextPos = helpers.unescapedIndexOf(line, PARAM_DELIMITER, valuePos); - var propValuePos = helpers.unescapedIndexOf(line, VALUE_DELIMITER, valuePos); + var nextPos = line.indexOf(PARAM_DELIMITER, valuePos); + var propValuePos = line.indexOf(VALUE_DELIMITER, valuePos); if (propValuePos !== -1 && nextPos > propValuePos) { // this is a delimiter in the property value, let's stop here nextPos = propValuePos; diff --git a/test/parser/property_params.ics b/test/parser/property_params.ics index 6fbc1094..522afdcb 100644 --- a/test/parser/property_params.ics +++ b/test/parser/property_params.ics @@ -9,6 +9,8 @@ ATTENDEE;DELEGATED-TO="mailto:foo7@bar";CN="Foo, Bar":mailto:foo5@bar ATTENDEE;DELEGATED-TO="mailto:foo7@bar";CN="Foo; Bar":mailto:foo6@bar ATTENDEE;ROLE="REQ-PARTICIPANT;foo";DELEGATED-FROM="mailto:bar@baz.com";PAR TSTAT=ACCEPTED;RSVP=TRUE:mailto:foo@bar.com +ATTENDEE;CN=X\:mailto:x@example.org +ATTENDEE;CN="Y\":mailto:y@example.org X-FOO;PARAM1=VAL1:FOO;BAR X-FOO2;PARAM1=VAL1;PARAM2=VAL2:FOO;BAR X-BAR;PARAM1="VAL1:FOO":BAZ;BAR diff --git a/test/parser/property_params.json b/test/parser/property_params.json index 65ef665d..1ce9abeb 100644 --- a/test/parser/property_params.json +++ b/test/parser/property_params.json @@ -69,6 +69,22 @@ "cal-address", "mailto:foo@bar.com" ], + [ + "attendee", + { + "cn": "X\\" + }, + "cal-address", + "mailto:x@example.org" + ], + [ + "attendee", + { + "cn": "Y\\" + }, + "cal-address", + "mailto:y@example.org" + ], [ "x-foo", {