You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that CollectionParser don't handle string escape
[Error: unterminated string literal]
[Near : {... ["key":"a"b"] ....}]
^
[Line: 1, Column: 14]
at org.mvel2.util.ParseTools.balancedCapture(ParseTools.java:1413)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:170)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:93)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:140)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:76)
at org.mvel2.ast.InlineCollectionNode.parseGraph(InlineCollectionNode.java:111)
at org.mvel2.ast.InlineCollectionNode.(InlineCollectionNode.java:49)
at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:1268)
at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:127)
at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:68)
at org.mvel2.MVEL.compileExpression(MVEL.java:827)
at org.mvel2.MVEL.compileExpression(MVEL.java:836)
at org.mvel2.MVEL.compileExpression(MVEL.java:740)
The text was updated successfully, but these errors were encountered:
I've taken a look at the method balancedCapture(char[] chars, int start, int end, char type) in ParseTools class, there is a code block like this:
if (type == term) {
for (start++; start < end; start++) {
if (chars[start] == type) {
returnstart;
}
}
}
What it was trying to do is basically finding out the terminate of a String literal. But since it is reading the whole char[] element by element, it cannot identify the '\' and '"' as a combination but rather treats them separately. So it thinks the String "a/"b" terminated as "a/".
I've opened a pull request to fix this problem. Check #317
version: 2.4.14.Final
It seems that CollectionParser don't handle string escape
[Error: unterminated string literal]
[Near : {... ["key":"a"b"] ....}]
^
[Line: 1, Column: 14]
at org.mvel2.util.ParseTools.balancedCapture(ParseTools.java:1413)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:170)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:93)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:140)
at org.mvel2.util.CollectionParser.parseCollection(CollectionParser.java:76)
at org.mvel2.ast.InlineCollectionNode.parseGraph(InlineCollectionNode.java:111)
at org.mvel2.ast.InlineCollectionNode.(InlineCollectionNode.java:49)
at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:1268)
at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:127)
at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:68)
at org.mvel2.MVEL.compileExpression(MVEL.java:827)
at org.mvel2.MVEL.compileExpression(MVEL.java:836)
at org.mvel2.MVEL.compileExpression(MVEL.java:740)
The text was updated successfully, but these errors were encountered: