fix:fixed the engine.eval() return double or Integer result in ArithmeticCaptchaAbstract.java
This commit is contained in:
parent
da3501451b
commit
1b851f198a
@ -39,7 +39,7 @@ public abstract class ArithmeticCaptchaAbstract extends Captcha {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("javascript");
|
||||
try {
|
||||
chars = String.valueOf(engine.eval(sb.toString().replaceAll("x", "*")));
|
||||
chars = String.valueOf(engine.eval(sb.toString().replaceAll("x", "*"))).split("\\.")[0];
|
||||
} catch (ScriptException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user