mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-02-06 05:26:36 +00:00
Minor refactoring
This commit is contained in:
@@ -338,6 +338,8 @@ def getUnicode(value, encoding=None, noneToNull=False):
|
||||
True
|
||||
>>> getUnicode(None) == 'None'
|
||||
True
|
||||
>>> getUnicode(b'/etc/passwd') == '/etc/passwd'
|
||||
True
|
||||
"""
|
||||
|
||||
# Best position for --time-limit mechanism
|
||||
@@ -354,7 +356,7 @@ def getUnicode(value, encoding=None, noneToNull=False):
|
||||
candidates = filterNone((encoding, kb.get("pageEncoding") if kb.get("originalPage") else None, conf.get("encoding"), UNICODE_ENCODING, sys.getfilesystemencoding()))
|
||||
if all(_ in value for _ in (b'<', b'>')):
|
||||
pass
|
||||
elif any(_ in value for _ in (b":\\", b'/', b'.')) and b'\n' not in value:
|
||||
elif b'\n' not in value and re.search(r"(?i)\w+\.\w{2,3}\Z|\A(\w:\\|/\w+)", six.text_type(value, UNICODE_ENCODING, errors="ignore")):
|
||||
candidates = filterNone((encoding, sys.getfilesystemencoding(), kb.get("pageEncoding") if kb.get("originalPage") else None, UNICODE_ENCODING, conf.get("encoding")))
|
||||
elif conf.get("encoding") and b'\n' not in value:
|
||||
candidates = filterNone((encoding, conf.get("encoding"), kb.get("pageEncoding") if kb.get("originalPage") else None, sys.getfilesystemencoding(), UNICODE_ENCODING))
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.enums import OS
|
||||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.9.12.52"
|
||||
VERSION = "1.9.12.53"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user