Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e3b3dea

Browse files
committed
Patch related to the #4167
1 parent 55595ed commit e3b3dea

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

lib/core/settings.py

Lines changed: 15 additions & 4 deletions
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.4.4.4"
21+
VERSION = "1.4.4.5"
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)
@@ -914,10 +914,21 @@
914914

915915
# Leaving (dirty) possibility to change values from here (e.g. `export SQLMAP__MAX_NUMBER_OF_THREADS=20`)
916916
for key, value in os.environ.items():
917-
if key.upper().startswith("%s_" % SQLMAP_ENVIRONMENT_PREFIX):
918-
_ = key[len(SQLMAP_ENVIRONMENT_PREFIX) + 1:].upper()
917+
if key.upper().startswith("%s" % SQLMAP_ENVIRONMENT_PREFIX):
918+
_ = key[len(SQLMAP_ENVIRONMENT_PREFIX):].upper()
919919
if _ in globals():
920-
globals()[_] = value
920+
original = globals()[_]
921+
if isinstance(original, int):
922+
try:
923+
globals()[_] = int(value)
924+
except ValueError:
925+
pass
926+
elif isinstance(original, bool):
927+
globals()[_] = value.lower() in ('1', 'true')
928+
elif isinstance(original, (list, tuple)):
929+
globals()[_] = [__.strip() for __ in _.split(',')]
930+
else:
931+
globals()[_] = value
921932

922933
# Installing "reversible" unicode (decoding) error handler
923934
def _reversible(ex):

0 commit comments

Comments
 (0)