diff --git a/lib/request/inject.py b/lib/request/inject.py index 3cf0077e3..ff3f823bd 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -479,4 +479,13 @@ def goStacked(expression, silent=False): return payload, page def checkBooleanExpression(expression, expectingNone=False): - return getValue(expression, expected="bool", expectingNone=expectingNone) + retVal = getValue(expression, expected="bool", expectingNone=expectingNone) + if isinstance(retVal, basestring): + retVal = retVal.lower() + if retVal in ("true", "false"): + retVal = bool(retVal) + else: + retVal = retVal != "0" + elif isinstance(retVal, int): + retVal = bool(retVal) + return retVal