-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 5.6
-
Fix Version/s: 5.6.0-HF09, 5.7.1
-
Component/s: Automation
When defining a groovy script for the operation Context.RunScript, special characters are XML-encoded to make the contribution valid.
However the character & is not decoded before evaluating the script, which raises the following error :
Caused by: [Error: could not access: amp; in class: null] [Near : {... Unknown ....}] ^ [Line: 1, Column: 0] at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:611) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:323) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:135) at org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:66) at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:139) at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:111) at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85) at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:108) at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:99) at org.mvel2.ast.IfNode.getReducedValueAccelerated(IfNode.java:62) at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85) at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:108) at org.mvel2.MVEL.executeExpression(MVEL.java:1057) at org.nuxeo.ecm.automation.core.scripting.MvelExpression.eval(MvelExpression.java:38) at org.nuxeo.ecm.automation.core.operations.RunScript.run(RunScript.java:48)
This character must be decoded, as it's done for "<" and ">"