mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
removed queriesfile.py, implemented XMLObject approach (still shell.py and udf.py TODO)
This commit is contained in:
@@ -142,6 +142,7 @@ class XMLFile:
|
||||
fobj = kw.get("file", None)
|
||||
raw = kw.get("raw", None)
|
||||
root = kw.get("root", None)
|
||||
textfilter = kw.get("textfilter", None)
|
||||
|
||||
if path:
|
||||
self.path = path
|
||||
@@ -176,6 +177,11 @@ class XMLFile:
|
||||
raise IncorrectRootTag("Gave root='%s', input has root='%s'" % (
|
||||
root, rootnode.nodeName))
|
||||
|
||||
if textfilter:
|
||||
self.textfilter = textfilter
|
||||
else:
|
||||
self.textfilter = lambda x: x
|
||||
|
||||
# need this for recursion in XMLNode
|
||||
self._childrenByName = {}
|
||||
self._children = []
|
||||
@@ -278,7 +284,7 @@ class XMLNode:
|
||||
self._value = None
|
||||
if isinstance(node, xml.dom.minidom.Text):
|
||||
self._type = "text"
|
||||
self._value = node.nodeValue
|
||||
self._value = self._root.textfilter(node.nodeValue)
|
||||
elif isinstance(node, xml.dom.minidom.Element):
|
||||
self._type = "node"
|
||||
elif isinstance(node, xml.dom.minidom.Comment):
|
||||
|
||||
Reference in New Issue
Block a user