mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-06-09 17:51:33 +00:00
removed queriesfile.py, implemented XMLObject approach (still shell.py and udf.py TODO)
This commit is contained in:
parent
be443c6947
commit
bc79eec702
16 changed files with 169 additions and 401 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue