Minor refactoring

This commit is contained in:
Miroslav Stampar
2025-12-31 10:35:40 +01:00
parent 883bd2398b
commit ba05bb6064
3 changed files with 6 additions and 4 deletions

View File

@@ -170,7 +170,7 @@ ac44a343947162532dbf17bd1f9ab424f8008f677367c5ad3f9f7b715a679818 lib/core/agent
86a9cb82c7e7beb4730264dae20bf3b7cd87c0dcaee587367362cf319f7bb079 lib/core/bigarray.py
f6062e324fdeaacf9df0a289fc3f12f755143e3876a70cb65b38aa2e690f73c1 lib/core/common.py
11c748cc96ea2bc507bc6c1930a17fe4bc6fdd2dd2a80430df971cb21428eb00 lib/core/compat.py
8ce42a336f9acc1a10874ee7be4492ae30fb08b79caea20512d109670a2fa159 lib/core/convert.py
c6e54bfb1e3bc116ced8d525978ba3f4a10a59b99bc48d895b73359df0682d9b lib/core/convert.py
ae500647c4074681749735a4f3b17b7eca44868dd3f39f9cab0a575888ba04a1 lib/core/data.py
b22decc8389c94a13f1adf07eb343cf3b2aae3fb3909fd4107e24bbede7c7deb lib/core/datatype.py
253309dc355ae27cd275e7de5a068e7e22feba603c4fe3429e2b69f8a51c0d13 lib/core/decorators.py
@@ -190,7 +190,7 @@ c4bfb493a03caf84dd362aec7c248097841de804b7413d0e1ecb8a90c8550bc0 lib/core/readl
d1bd70c1a55858495c727fbec91e30af267459c8f64d50fabf9e4ee2c007e920 lib/core/replication.py
1d0f80b0193ac5204527bfab4bde1a7aee0f693fd008e86b4b29f606d1ef94f3 lib/core/revision.py
d2eb8e4b05ac93551272b3d4abfaf5b9f2d3ac92499a7704c16ed0b4f200db38 lib/core/session.py
133e0f45cb7f03ea2322235892d6dff38302ddf65c0a7940976e6f54d65147b4 lib/core/settings.py
72affdfd108cd7c4c10b54389917b018731e592a5f8e087c38e14620bea551d0 lib/core/settings.py
1c5eab9494eb969bc9ce118a2ea6954690c6851cbe54c18373c723b99734bf09 lib/core/shell.py
4eea6dcf023e41e3c64b210cb5c2efc7ca893b727f5e49d9c924f076bb224053 lib/core/subprocessng.py
cdd352e1331c6b535e780f6edea79465cb55af53aa2114dcea0e8bf382e56d1a lib/core/target.py

View File

@@ -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))

View File

@@ -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)