From d2a3e8f44fc80805cbf2a31d13ee5b465d1a437c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 11 Dec 2010 11:17:24 +0000 Subject: [PATCH] first time firebird error-based query success --- lib/core/common.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 154a87a78..47546fca0 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1708,11 +1708,22 @@ def removeDynamicContent(page): def isDBMSVersionAtLeast(version): retVal = None + try: + version = float(version) + except ValueError, _: + raise sqlmapSyntaxException, "parameter version (%s) must be a floating point number" % version - if version: - if not isinstance(version, basestring): - version = str(version) - if kb.dbmsVersion and kb.dbmsVersion[0] != "Unknown" and kb.dbmsVersion[0] != None: - retVal = kb.dbmsVersion[0] >= version + if kb.dbmsVersion and kb.dbmsVersion[0] != "Unknown" and kb.dbmsVersion[0] != None: + value = kb.dbmsVersion[0].replace(" ", "") + if isinstance(value, basestring): + if value.startswith(">="): + value = float(value.replace(">=", "")) + elif value.startswith(">"): + value = float(value.replace(">", "")) + 0.01 + elif value.startswith("<="): + value = float(value.replace("<=", "")) + elif value.startswith(">"): + value = float(value.replace("<", "")) - 0.01 + retVal = value >= version return retVal