Tamper function(s) refactoring (really no need for returning headers as they are passed by reference)

This commit is contained in:
Miroslav Stampar
2012-10-25 10:10:23 +02:00
parent 54fbb22ab8
commit 12fc9442b9
36 changed files with 70 additions and 72 deletions

View File

@@ -18,7 +18,7 @@ __priority__ = PRIORITY.HIGHER
def dependencies():
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
def tamper(payload, headers):
def tamper(payload, headers=None):
"""
Encloses each non-function keyword with versioned MySQL comment
@@ -50,4 +50,4 @@ def tamper(payload, headers):
retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=[^\w(]|\Z)", lambda match: process(match), retVal)
retVal = retVal.replace(" /*!", "/*!").replace("*/ ", "*/")
return retVal, headers
return retVal