[FIX] mail: replace special characters

When the delimiter '@' is used in the composer, a regular expression is
built in order to suggest followers. However, if this regular expression
is incorrect, it causes a crash since RegExp will throw a syntax error.
Since a new regular expression is built for each new character the user
types, this situation can occur very easily. For example, typing '@('
will cause a crash.

This fix replaces characters which may easily lead to a syntax error by
a space.
This commit is contained in:
Nicolas Martinelli
2015-12-09 09:36:41 +01:00
parent 623fbf58f0
commit 07425d407f
+1
View File
@@ -23,6 +23,7 @@ var accented_letters_mapping = {
'oe': 'œ',
'u': '[ùúûűü]',
'y': '[ýÿ]',
' ': '[()\\[\\]]',
};
// The MentionManager allows the Composer to register listeners. For each