MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / cleanQuery

Function cleanQuery

lib/core/common.py:1471–1489  ·  view source on GitHub ↗

Switch all SQL statement (alike) keywords to upper case >>> cleanQuery("select id from users") 'SELECT id FROM users'

(query)

Source from the content-addressed store, hash-verified

1469 return retVal
1470
1471def cleanQuery(query):
1472 """
1473 Switch all SQL statement (alike) keywords to upper case
1474
1475 >>> cleanQuery("select id from users")
1476 'SELECT id FROM users'
1477 """
1478
1479 retVal = query
1480
1481 for sqlStatements in SQL_STATEMENTS.values():
1482 for sqlStatement in sqlStatements:
1483 candidate = sqlStatement.replace("(", "").replace(")", "").strip()
1484 queryMatch = re.search(r"(?i)\b(%s)\b" % candidate, query)
1485
1486 if queryMatch and "sys_exec" not in query:
1487 retVal = retVal.replace(queryMatch.group(1), candidate.upper())
1488
1489 return retVal
1490
1491def cleanReplaceUnicode(value):
1492 """

Callers 2

getValueFunction · 0.90
goStackedFunction · 0.90

Calls 3

valuesMethod · 0.80
replaceMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…