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