2010-10-13 18:27:35 +04:00
|
|
|
import re
|
|
|
|
|
|
|
|
from lib.core.convert import urldecode
|
|
|
|
from lib.core.convert import urlencode
|
|
|
|
|
|
|
|
"""
|
2010-10-14 10:20:32 +04:00
|
|
|
' ' -> /**/ (e.g., SELECT id FROM users->SELECT/**/id/**/FROM users)
|
2010-10-13 18:27:35 +04:00
|
|
|
"""
|
2010-10-14 10:40:56 +04:00
|
|
|
#TODO: only do it for deepness = 0 regarding '"
|
2010-10-13 18:27:35 +04:00
|
|
|
def tamper(place, value):
|
|
|
|
if value:
|
|
|
|
if place != "URI":
|
|
|
|
value = urldecode(value)
|
2010-10-14 00:54:18 +04:00
|
|
|
value = value.replace(" ", "/**/")
|
2010-10-13 18:27:35 +04:00
|
|
|
if place != "URI":
|
|
|
|
value = urlencode(value)
|
|
|
|
return value
|