Skip to content

Commit a25de42

Browse files
committed
Refactoring of obsolete switch/options cases
1 parent 4857f36 commit a25de42

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

lib/core/common.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
from lib.core.defaults import defaults
6969
from lib.core.dicts import DBMS_DICT
7070
from lib.core.dicts import DEFAULT_DOC_ROOTS
71-
from lib.core.dicts import OLD_OPTIONS
71+
from lib.core.dicts import OBSOLETE_OPTIONS
7272
from lib.core.dicts import SQL_STATEMENTS
7373
from lib.core.enums import ADJUST_TIME_DELAY
7474
from lib.core.enums import CONTENT_STATUS
@@ -4457,19 +4457,17 @@ def getHostHeader(url):
44574457

44584458
return retVal
44594459

4460-
def checkOldOptions(args):
4460+
def checkObsoleteOptions(args):
44614461
"""
4462-
Checks for deprecated/obsolete options
4462+
Checks for obsolete options
44634463
"""
44644464

44654465
for _ in args:
44664466
_ = _.split('=')[0].strip()
4467-
if _ in OLD_OPTIONS:
4468-
if OLD_OPTIONS[_]:
4469-
errMsg = "switch/option '%s' is deprecated" % _
4470-
errMsg += " (hint: %s)" % OLD_OPTIONS[_]
4471-
else:
4472-
errMsg = "switch/option '%s' is obsolete" % _
4467+
if _ in OBSOLETE_OPTIONS:
4468+
errMsg = "switch/option '%s' is obsolete" % _
4469+
if OBSOLETE_OPTIONS[_]:
4470+
errMsg += " (hint: %s)" % OBSOLETE_OPTIONS[_]
44734471
raise SqlmapSyntaxException(errMsg)
44744472

44754473
def checkSystemEncoding():

lib/core/dicts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
POST_HINT.ARRAY_LIKE: "application/x-www-form-urlencoded; charset=utf-8",
281281
}
282282

283-
OLD_OPTIONS = {
283+
OBSOLETE_OPTIONS = {
284284
"--replicate": "use '--dump-format=SQLITE' instead",
285285
"--no-unescape": "use '--no-escape' instead",
286286
"--binary": "use '--binary-fields' instead",
@@ -290,7 +290,7 @@
290290
"--purge-output": "use '--purge' instead",
291291
"--check-payload": None,
292292
"--check-waf": None,
293-
"--identify-waf": None,
293+
"--identify-waf": "functionality being done automatically",
294294
"--pickled-options": "use '--api -c ...' instead",
295295
}
296296

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.145"
21+
VERSION = "1.3.5.146"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/parse/cmdline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from optparse import OptionParser
1818
from optparse import SUPPRESS_HELP
1919

20-
from lib.core.common import checkOldOptions
20+
from lib.core.common import checkObsoleteOptions
2121
from lib.core.common import checkSystemEncoding
2222
from lib.core.common import dataToStdout
2323
from lib.core.common import expandMnemonics
@@ -789,7 +789,7 @@ def _(self, *args):
789789
_.append(getUnicode(arg, encoding=sys.stdin.encoding))
790790

791791
argv = _
792-
checkOldOptions(argv)
792+
checkObsoleteOptions(argv)
793793

794794
prompt = "--sqlmap-shell" in argv
795795

0 commit comments

Comments
 (0)