From 8b57e1fce6f6c101305d7420bd9dd3e6e0fbec57 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 15 Oct 2012 23:15:52 +0200 Subject: [PATCH] Minor update for an Issue #203 --- lib/core/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 4e5f6b5a9..c00272a7c 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1962,7 +1962,7 @@ def extractErrorMessage(page): return retVal -def urldecode(value, encoding=None, convall=False): +def urldecode(value, encoding=None, unsafe="%&=", convall=False): result = None if value: @@ -1976,7 +1976,7 @@ def urldecode(value, encoding=None, convall=False): result = urllib.unquote_plus(value) else: def _(match): - charset = string.printable.replace("&", "") + charset = reduce(lambda x, y: x.replace(y, ""), unsafe, string.printable) char = chr(ord(match.group(1).decode("hex"))) return char if char in charset else match.group(0) result = re.sub("%([0-9a-fA-F]{2})", _, value)