(js) Fix sanitisation of flags in Sieve filters

Fixes #4087
This commit is contained in:
Francis Lachapelle
2017-03-22 13:26:43 -04:00
parent 5ff8463fba
commit e7a06c42a4
2 changed files with 18 additions and 2 deletions
@@ -22,9 +22,16 @@
return ['_' + key, value];
return [key, value];
}));
data.SOGoMailLabelsColors = labels;
_.forEach(data.SOGoSieveFilters, function(filter) {
_.forEach(filter.actions, function(action) {
if (action.method == 'addflag' &&
action.argument.charAt(0) == '$')
action.argument = '_' + action.argument;
});
});
if (data.SOGoRememberLastModule)
data.SOGoLoginModule = "Last";
@@ -260,9 +267,17 @@
}
return [key, value];
}));
preferences.defaults.SOGoMailLabelsColors = labels;
_.forEach(preferences.defaults.SOGoSieveFilters, function(filter) {
_.forEach(filter.actions, function(action) {
if (action.method == 'addflag' &&
action.argument.charAt(0) == '_' &&
action.argument.charAt(1) == '$')
action.argument = action.argument.substring(1);
});
});
if (!preferences.defaults.SOGoMailComposeFontSizeEnabled)
preferences.defaults.SOGoMailComposeFontSize = 0;
delete preferences.defaults.SOGoMailComposeFontSizeEnabled;