Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6014648

Browse files
committed
bug fix(es) (flags were used in place of count parameter in re.sub() calls)
1 parent 9433bbe commit 6014648

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/core/convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def urlencode(value, safe="%&=", convall=False, limit=False):
9696
# encoded (when not representing url encoded char)
9797
# except in cases when tampering scripts are used
9898
if all(map(lambda x: '%' in x, [safe, value])) and not kb.tamperFunctions:
99-
value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value, re.DOTALL | re.IGNORECASE)
99+
value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value)
100100

101101
while True:
102102
result = urllib.quote(utf8encode(value), safe)

lib/request/basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def forgeHeaders(items=None):
6161
kb.mergeCookies = not test or test[0] in ("y", "Y")
6262

6363
if kb.mergeCookies:
64-
_ = lambda x: re.sub("%s=[^%s]+" % (cookie.name, DEFAULT_COOKIE_DELIMITER), "%s=%s" % (cookie.name, cookie.value), x, re.I)
64+
_ = lambda x: re.sub("(?i)%s=[^%s]+" % (cookie.name, DEFAULT_COOKIE_DELIMITER), "%s=%s" % (cookie.name, cookie.value), x)
6565
headers[HTTPHEADER.COOKIE] = _(headers[HTTPHEADER.COOKIE])
6666

6767
if PLACE.COOKIE in conf.parameters:

0 commit comments

Comments
 (0)