mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
Minor patch
This commit is contained in:
parent
57047ba8cf
commit
e62e8c6cea
3 changed files with 8 additions and 8 deletions
|
|
@ -1411,7 +1411,7 @@ def parseJson(content):
|
|||
"""
|
||||
This function parses POST_HINT.JSON and POST_HINT.JSON_LIKE content
|
||||
|
||||
>>> parseJson("{'id':1}")["id"] == 1
|
||||
>>> parseJson("{'id':1, 'foo':[2,3,4]}")["id"] == 1
|
||||
True
|
||||
>>> parseJson('{"id":1}')["id"] == 1
|
||||
True
|
||||
|
|
@ -1429,10 +1429,10 @@ def parseJson(content):
|
|||
if quote == '"':
|
||||
retVal = json.loads(content)
|
||||
elif quote == "'":
|
||||
content = content.replace('"', '\\"')
|
||||
content = content.replace("\\'", BOUNDARY_BACKSLASH_MARKER)
|
||||
content = content.replace("'", '"')
|
||||
content = content.replace(BOUNDARY_BACKSLASH_MARKER, "'")
|
||||
def _(match):
|
||||
return '"%s"' % match.group(1).replace('"', '\\"')
|
||||
|
||||
content = re.sub(r"'((?:[^'\\]|\\.)*)'", _, content)
|
||||
retVal = json.loads(content)
|
||||
except:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue