From 6afc9bffaa6e2e12aa5fc4d61ecd043da9aec222 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Sun, 31 Oct 2010 11:09:29 +0000 Subject: [PATCH] Minor bug fix: there will always be only one pair of delimiters as we add it for each place --- lib/core/agent.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index fe48c4e0a..fd8e6cde1 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -623,13 +623,10 @@ class Agent: retVal = inpStr if inpStr: - if urlencode_: - regObj = getCompiledRegex("(?P%s.*?%s)" % (PAYLOAD_DELIMITER, PAYLOAD_DELIMITER)) + retVal = retVal.replace(PAYLOAD_DELIMITER, '') - for match in regObj.finditer(inpStr): - retVal = retVal.replace(match.group("result"), urlencode(match.group("result")[1:-1], convall=True)) - else: - retVal = retVal.replace(PAYLOAD_DELIMITER, '') + if urlencode_: + retVal = urlencode(retVal) return retVal