Couple of patches

This commit is contained in:
Miroslav Stampar
2020-02-12 16:21:09 +01:00
parent 0605f14d87
commit 0453a2827c
6 changed files with 20 additions and 15 deletions

View File

@@ -2844,6 +2844,7 @@ def urlencode(value, safe="%&=-_", convall=False, limit=False, spaceplus=False):
# except in cases when tampering scripts are used
if all('%' in _ for _ in (safe, value)) and not kb.tamperFunctions:
value = re.sub(r"%(?![0-9a-fA-F]{2})", "%25", value)
value = re.sub(r"(?<= ')%", "%25", value) # e.g. LIKE '%DBA%'
while True:
result = _urllib.parse.quote(getBytes(value), safe)