mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-09 16:10:35 +03:00
Minor update
This commit is contained in:
parent
1eeb6c1f5b
commit
9459d5ea15
|
@ -2419,17 +2419,10 @@ def getUnicode(value, encoding=None, noneToNull=False):
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
while True:
|
try:
|
||||||
try:
|
return six.text_type(value, encoding or (kb.get("pageEncoding") if kb.get("originalPage") else None) or UNICODE_ENCODING)
|
||||||
return six.text_type(value, encoding or (kb.get("pageEncoding") if kb.get("originalPage") else None) or UNICODE_ENCODING)
|
except UnicodeDecodeError as ex:
|
||||||
except UnicodeDecodeError as ex:
|
return six.text_type(value, UNICODE_ENCODING, errors="reversible")
|
||||||
try:
|
|
||||||
return six.text_type(value, UNICODE_ENCODING)
|
|
||||||
except:
|
|
||||||
if INVALID_UNICODE_PRIVATE_AREA:
|
|
||||||
value = value[:ex.start] + "".join(unichr(int('000f00%2x' % ord(_), 16)).encode(UNICODE_ENCODING) for _ in value[ex.start:ex.end]) + value[ex.end:]
|
|
||||||
else:
|
|
||||||
value = value[:ex.start] + "".join(INVALID_UNICODE_CHAR_FORMAT % ord(_) for _ in value[ex.start:ex.end]) + value[ex.end:]
|
|
||||||
elif isListLike(value):
|
elif isListLike(value):
|
||||||
value = list(getUnicode(_, encoding, noneToNull) for _ in value)
|
value = list(getUnicode(_, encoding, noneToNull) for _ in value)
|
||||||
return value
|
return value
|
||||||
|
|
|
@ -17,7 +17,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||||
from lib.core.enums import OS
|
from lib.core.enums import OS
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.3.4.16"
|
VERSION = "1.3.4.15"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
@ -825,7 +825,6 @@ th{
|
||||||
</style>"""
|
</style>"""
|
||||||
|
|
||||||
# Leaving (dirty) possibility to change values from here (e.g. `export SQLMAP__MAX_NUMBER_OF_THREADS=20`)
|
# Leaving (dirty) possibility to change values from here (e.g. `export SQLMAP__MAX_NUMBER_OF_THREADS=20`)
|
||||||
|
|
||||||
for key, value in os.environ.items():
|
for key, value in os.environ.items():
|
||||||
if key.upper().startswith("%s_" % SQLMAP_ENVIRONMENT_PREFIX):
|
if key.upper().startswith("%s_" % SQLMAP_ENVIRONMENT_PREFIX):
|
||||||
_ = key[len(SQLMAP_ENVIRONMENT_PREFIX) + 1:].upper()
|
_ = key[len(SQLMAP_ENVIRONMENT_PREFIX) + 1:].upper()
|
||||||
|
@ -833,9 +832,11 @@ for key, value in os.environ.items():
|
||||||
globals()[_] = value
|
globals()[_] = value
|
||||||
|
|
||||||
# Installing "reversible" unicode (decoding) error handler
|
# Installing "reversible" unicode (decoding) error handler
|
||||||
|
def _reversible(ex):
|
||||||
def reversible(ex):
|
|
||||||
if isinstance(ex, UnicodeDecodeError):
|
if isinstance(ex, UnicodeDecodeError):
|
||||||
return ("".join(INVALID_UNICODE_CHAR_FORMAT % ord(_) for _ in ex.object[ex.start:ex.end]).decode(UNICODE_ENCODING), ex.end)
|
if INVALID_UNICODE_PRIVATE_AREA:
|
||||||
|
return ("".join(unichr(int('000f00%2x' % ord(_), 16)) for _ in ex.object[ex.start:ex.end]), ex.end)
|
||||||
|
else:
|
||||||
|
return ("".join(INVALID_UNICODE_CHAR_FORMAT % ord(_) for _ in ex.object[ex.start:ex.end]).decode(UNICODE_ENCODING), ex.end)
|
||||||
|
|
||||||
codecs.register_error("reversible", reversible)
|
codecs.register_error("reversible", _reversible)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user