From 25a3a64327edcd6580da6280f894ca6d98fa0955 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 12 Feb 2011 10:15:42 +0000 Subject: [PATCH] we need this because of one pesky little bug going around (when union is recognized and the dbmses are fingerprinted, for those who don't have proper unescaping false TRUE is recognized in form of retrieved: %27%2B%28SELECT%20CAST...). tested on all major DBMSes. --- lib/request/inject.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/request/inject.py b/lib/request/inject.py index 7a25d1c25..3ef28e3ea 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -475,12 +475,15 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse if value and expected == EXPECTED.BOOL: if isinstance(value, basestring): + value = value.strip() if value.lower() in ("true", "false"): value = bool(value) elif value.capitalize() == "None": value = None + elif value in ("1", "-1"): + value = True else: - value = value != "0" + value = None elif isinstance(value, int): value = bool(value) elif value == [None]: