summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/calendar/calendar_ui.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index df4a50d..2190d02 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -81,16 +81,18 @@ function rcube_calendar_ui(settings)
{
var result = [],
strlen = str.length,
- q, p, i;
+ q, p, i, char, last;
for (q = p = i = 0; i < strlen; i++) {
- if (str[i] == '"' && str[i-1] != '\\') {
+ char = str.charAt(i);
+ if (char == '"' && last != '\\') {
q = !q;
}
- else if (!q && str[i] == delimiter) {
+ else if (!q && char == delimiter) {
result.push(str.substring(p, i));
p = i + 1;
}
+ last = char;
}
result.push(str.substr(p));