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

Skip to content

Commit e2db0d2

Browse files
committed
Minor update
1 parent f344a01 commit e2db0d2

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

lib/core/common.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ def safeStringFormat(format_, params):
18971897
if isinstance(params, six.string_types):
18981898
retVal = retVal.replace("%s", params, 1)
18991899
elif not isListLike(params):
1900-
retVal = retVal.replace("%s", getText(params), 1)
1900+
retVal = retVal.replace("%s", getUnicode(params), 1)
19011901
else:
19021902
start, end = 0, len(retVal)
19031903
match = re.search(r"%s(.+)%s" % (PAYLOAD_DELIMITER, PAYLOAD_DELIMITER), retVal)
@@ -1906,7 +1906,7 @@ def safeStringFormat(format_, params):
19061906
if retVal.count("%s", start, end) == len(params):
19071907
for param in params:
19081908
index = retVal.find("%s", start)
1909-
retVal = retVal[:index] + getText(param) + retVal[index + 2:]
1909+
retVal = retVal[:index] + getUnicode(param) + retVal[index + 2:]
19101910
else:
19111911
if any('%s' in _ for _ in conf.parameters.values()):
19121912
parts = format_.split(' ')
@@ -1930,6 +1930,9 @@ def safeStringFormat(format_, params):
19301930
count += 1
19311931
else:
19321932
break
1933+
1934+
retVal = getText(retVal)
1935+
19331936
return retVal
19341937

19351938
def getFilteredPageContent(page, onlyText=True, split=" "):
@@ -4115,10 +4118,10 @@ def asciifyUrl(url, forceQuote=False):
41154118
parts = _urllib.parse.urlsplit(url)
41164119
if not parts.scheme or not parts.netloc:
41174120
# apparently not an url
4118-
return url
4121+
return getText(url)
41194122

41204123
if all(char in string.printable for char in url):
4121-
return url
4124+
return getText(url)
41224125

41234126
# idna-encode domain
41244127
try:
@@ -4160,7 +4163,7 @@ def quote(s, safe):
41604163
if port:
41614164
netloc += ':' + str(port)
41624165

4163-
return _urllib.parse.urlunsplit([parts.scheme, netloc, path, query, parts.fragment]) or url
4166+
return getText(_urllib.parse.urlunsplit([parts.scheme, netloc, path, query, parts.fragment]) or url)
41644167

41654168
def isAdminFromPrivileges(privileges):
41664169
"""
@@ -4193,9 +4196,9 @@ def isAdminFromPrivileges(privileges):
41934196

41944197
def findPageForms(content, url, raise_=False, addToTargets=False):
41954198
"""
4196-
Parses given page content for possible forms
4199+
Parses given page content for possible forms (Note: still not implemented for Python3)
41974200
4198-
>>> findPageForms('<html><form action="/input.php" method="POST"><input type="text" name="id" value="1"><input type="submit" value="Submit"></form></html>', '')
4201+
>> findPageForms('<html><form action="/input.php" method="POST"><input type="text" name="id" value="1"><input type="submit" value="Submit"></form></html>', '')
41994202
set([(u'/input.php', 'POST', u'id=1', None, None)])
42004203
"""
42014204

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 import six
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.17"
21+
VERSION = "1.3.5.18"
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)

0 commit comments

Comments
 (0)