mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Some more Python 3.9 patching
This commit is contained in:
parent
44b7cc7d17
commit
2a1e812288
|
@ -44,7 +44,7 @@ def parseXmlNode(node):
|
|||
for element in node.findall("boundary"):
|
||||
boundary = AttribDict()
|
||||
|
||||
for child in element.getchildren():
|
||||
for child in element:
|
||||
if child.text:
|
||||
values = cleanupVals(child.text, child.tag)
|
||||
boundary[child.tag] = values
|
||||
|
@ -56,18 +56,18 @@ def parseXmlNode(node):
|
|||
for element in node.findall("test"):
|
||||
test = AttribDict()
|
||||
|
||||
for child in element.getchildren():
|
||||
for child in element:
|
||||
if child.text and child.text.strip():
|
||||
values = cleanupVals(child.text, child.tag)
|
||||
test[child.tag] = values
|
||||
else:
|
||||
if len(child.getchildren()) == 0:
|
||||
if len(child.findall("*")) == 0:
|
||||
test[child.tag] = None
|
||||
continue
|
||||
else:
|
||||
test[child.tag] = AttribDict()
|
||||
|
||||
for gchild in child.getchildren():
|
||||
for gchild in child:
|
||||
if gchild.tag in test[child.tag]:
|
||||
prevtext = test[child.tag][gchild.tag]
|
||||
test[child.tag][gchild.tag] = [prevtext, gchild.text]
|
||||
|
@ -77,6 +77,15 @@ def parseXmlNode(node):
|
|||
conf.tests.append(test)
|
||||
|
||||
def loadBoundaries():
|
||||
"""
|
||||
Loads boundaries from XML
|
||||
|
||||
>>> conf.boundaries = []
|
||||
>>> loadBoundaries()
|
||||
>>> len(conf.boundaries) > 0
|
||||
True
|
||||
"""
|
||||
|
||||
try:
|
||||
doc = et.parse(paths.BOUNDARIES_XML)
|
||||
except Exception as ex:
|
||||
|
@ -89,6 +98,15 @@ def loadBoundaries():
|
|||
parseXmlNode(root)
|
||||
|
||||
def loadPayloads():
|
||||
"""
|
||||
Loads payloads/tests from XML
|
||||
|
||||
>>> conf.tests = []
|
||||
>>> loadPayloads()
|
||||
>>> len(conf.tests) > 0
|
||||
True
|
||||
"""
|
||||
|
||||
for payloadFile in PAYLOAD_XML_FILES:
|
||||
payloadFilePath = os.path.join(paths.SQLMAP_XML_PAYLOADS_PATH, payloadFile)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user