MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / _adjustParameter

Method _adjustParameter

lib/request/connect.py:1221–1235  ·  view source on GitHub ↗
(paramString, parameter, newValue)

Source from the content-addressed store, hash-verified

1219 token = AttribDict()
1220
1221 def _adjustParameter(paramString, parameter, newValue):
1222 retVal = paramString
1223
1224 if urlencode(parameter) in paramString:
1225 parameter = urlencode(parameter)
1226
1227 match = re.search(r"%s=[^&]*" % re.escape(parameter), paramString, re.I)
1228 if match:
1229 retVal = re.sub(r"(?i)%s" % re.escape(match.group(0)), ("%s=%s" % (parameter, newValue)).replace('\\', r'\\'), paramString)
1230 else:
1231 match = re.search(r"(%s[\"']\s*:\s*[\"'])([^\"']*)" % re.escape(parameter), paramString, re.I)
1232 if match:
1233 retVal = re.sub(r"(?i)%s" % re.escape(match.group(0)), "%s%s" % (match.group(1), newValue), paramString)
1234
1235 return retVal
1236
1237 for attempt in xrange(conf.csrfRetries + 1):
1238 if token:

Callers

nothing calls this directly

Calls 4

urlencodeFunction · 0.90
searchMethod · 0.45
escapeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected