Minor bug fix: there will always be only one pair of delimiters as we add it for each place

This commit is contained in:
Bernardo Damele 2010-10-31 11:09:29 +00:00
parent 3a48bee9b0
commit 6afc9bffaa

View File

@ -623,13 +623,10 @@ class Agent:
retVal = inpStr retVal = inpStr
if inpStr: if inpStr:
if urlencode_: retVal = retVal.replace(PAYLOAD_DELIMITER, '')
regObj = getCompiledRegex("(?P<result>%s.*?%s)" % (PAYLOAD_DELIMITER, PAYLOAD_DELIMITER))
for match in regObj.finditer(inpStr): if urlencode_:
retVal = retVal.replace(match.group("result"), urlencode(match.group("result")[1:-1], convall=True)) retVal = urlencode(retVal)
else:
retVal = retVal.replace(PAYLOAD_DELIMITER, '')
return retVal return retVal