From dc1623a40fc35ce11b452f682476460f0c613910 Mon Sep 17 00:00:00 2001 From: stamparm Date: Thu, 11 Jul 2013 10:20:58 +0200 Subject: [PATCH] Fix for a bug reported over ML (error: unbalanced parenthesis) --- lib/core/agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 61fdff7cd..6213935e9 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -142,7 +142,7 @@ class Agent(object): elif place in (PLACE.USER_AGENT, PLACE.REFERER, PLACE.HOST): retVal = paramString.replace(origValue, self.addPayloadDelimiters(newValue)) else: - retVal = re.sub(r"(\A|\b)%s=%s" % (parameter, origValue), "%s=%s" % (parameter, self.addPayloadDelimiters(newValue)), paramString) + retVal = re.sub(r"(\A|\b)%s=%s" % (re.escape(parameter), re.escape(origValue)), "%s=%s" % (parameter, self.addPayloadDelimiters(newValue)), paramString) return retVal