This commit is contained in:
Miroslav Stampar
2018-04-11 15:19:44 +02:00
parent a8cb14ed4a
commit 148d1c9ff9
4 changed files with 24 additions and 12 deletions

View File

@@ -1493,6 +1493,23 @@ def parseTargetUrl():
if conf.url != originalUrl:
kb.originalUrls[conf.url] = originalUrl
def escapeJsonValue(value):
"""
Escapes JSON value (used in payloads)
# Reference: https://stackoverflow.com/a/16652683
"""
retVal = ""
for char in value:
if char < ' ' or char == '"':
retVal += json.dumps(char)[1:-1]
else:
retVal += char
return retVal
def expandAsteriskForColumns(expression):
"""
If the user provided an asterisk rather than the column(s)