diff --git a/lib/core/agent.py b/lib/core/agent.py index 56bca45c6..4a37bd63a 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -624,13 +624,15 @@ class Agent: if inpStr: if urlencode_: - regObj = getCompiledRegex("%s(?P.*?)%s" % (PAYLOAD_DELIMITER, PAYLOAD_DELIMITER)) + regObj = getCompiledRegex("(?P%s.*?%s)" % (PAYLOAD_DELIMITER, PAYLOAD_DELIMITER)) for match in regObj.finditer(inpStr): - retVal = retVal.replace(match.group("result"), urlencode(match.group("result"), convall=True)) + retVal = retVal.replace(match.group("result"), urlencode(match.group("result").strip(PAYLOAD_DELIMITER), convall=True)) else: retVal = retVal.replace(PAYLOAD_DELIMITER, '') + print retVal + return retVal def extractPayload(self, inpStr):