From 6a271fe800712a3f046284b5c3671c6a88e6526c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 19 Oct 2012 11:29:03 +0200 Subject: [PATCH] Update for an Issue #2 --- lib/request/basic.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/request/basic.py b/lib/request/basic.py index 0fca87bb6..130ad0f00 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -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])