Update for an Issue #2

This commit is contained in:
Miroslav Stampar 2012-10-19 11:29:03 +02:00
parent 998eb70288
commit 6a271fe800

View File

@ -263,10 +263,13 @@ def processResponse(page, responseHeaders):
if msg:
logger.info("parsed error message: '%s'" % msg)
for regex in (EVENTVALIDATION_REGEX, VIEWSTATE_REGEX):
match = re.search(regex, page, re.I)
if match and PLACE.POST in conf.parameters:
name, value = match.groups()
conf.parameters[PLACE.POST] = re.sub("(?i)(%s=)[^&]+" % name, r"\g<1>%s" % value, conf.parameters[PLACE.POST])
if PLACE.POST in conf.paramDict and name in conf.paramDict[PLACE.POST]:
conf.paramDict[PLACE.POST][name] = value
if kb.originalPage is None:
for regex in (EVENTVALIDATION_REGEX, VIEWSTATE_REGEX):
match = re.search(regex, page, re.I)
if match and PLACE.POST in conf.parameters:
name, value = match.groups()
if PLACE.POST in conf.paramDict and name in conf.paramDict[PLACE.POST]:
if conf.paramDict[PLACE.POST][name] in page:
continue
conf.paramDict[PLACE.POST][name] = value
conf.parameters[PLACE.POST] = re.sub("(?i)(%s=)[^&]+" % name, r"\g<1>%s" % value, conf.parameters[PLACE.POST])