From 60146481afa8a2364718a4cfdbf2c5f8a0fefab7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 28 Mar 2012 19:33:00 +0000 Subject: [PATCH] bug fix(es) (flags were used in place of count parameter in re.sub() calls) --- lib/core/convert.py | 2 +- lib/request/basic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/convert.py b/lib/core/convert.py index 7d619099c..f94d368ec 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -96,7 +96,7 @@ def urlencode(value, safe="%&=", convall=False, limit=False): # encoded (when not representing url encoded char) # except in cases when tampering scripts are used if all(map(lambda x: '%' in x, [safe, value])) and not kb.tamperFunctions: - value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value, re.DOTALL | re.IGNORECASE) + value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value) while True: result = urllib.quote(utf8encode(value), safe) diff --git a/lib/request/basic.py b/lib/request/basic.py index df15c59d5..6f411275e 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -61,7 +61,7 @@ def forgeHeaders(items=None): kb.mergeCookies = not test or test[0] in ("y", "Y") if kb.mergeCookies: - _ = lambda x: re.sub("%s=[^%s]+" % (cookie.name, DEFAULT_COOKIE_DELIMITER), "%s=%s" % (cookie.name, cookie.value), x, re.I) + _ = lambda x: re.sub("(?i)%s=[^%s]+" % (cookie.name, DEFAULT_COOKIE_DELIMITER), "%s=%s" % (cookie.name, cookie.value), x) headers[HTTPHEADER.COOKIE] = _(headers[HTTPHEADER.COOKIE]) if PLACE.COOKIE in conf.parameters: