From 47a42c234e890d468814529c0ebbac6163b3b84f Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 10 Oct 2015 19:19:50 +0200 Subject: [PATCH] Fixes #1459 --- lib/core/agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index c6827461d..e2963f01b 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -308,8 +308,8 @@ class Agent(object): for _ in set(re.findall(r"\[RANDSTR(?:\d+)?\]", payload, re.I)): payload = payload.replace(_, randomStr()) - if origValue is not None: - payload = payload.replace("[ORIGVALUE]", origValue if origValue.isdigit() else unescaper.escape("'%s'" % origValue)) + if origValue is not None and "[ORIGVALUE]" in payload: + payload = getUnicode(payload).replace("[ORIGVALUE]", origValue if origValue.isdigit() else unescaper.escape("'%s'" % origValue)) if "[INFERENCE]" in payload: if Backend.getIdentifiedDbms() is not None: