From 54d65328bc52ffb1cfec6f05943712f3c60a1276 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 18 Aug 2015 03:09:01 +0200 Subject: [PATCH] Patch for negative logic (e.g. OR) cases (reported privately) --- lib/request/comparison.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 0cfb53957..b3d76ea27 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -77,7 +77,7 @@ def _comparison(page, headers, code, getRatioValue, pageLength): if page: # In case of an DBMS error page return None - if kb.errorIsNone and (wasLastResponseDBMSError() or wasLastResponseHTTPError()): + if kb.errorIsNone and (wasLastResponseDBMSError() or wasLastResponseHTTPError()) and not kb.negativeLogic: return None # Dynamic content lines to be excluded before comparison @@ -165,6 +165,9 @@ def _comparison(page, headers, code, getRatioValue, pageLength): elif ratio > UPPER_RATIO_BOUND: return True + elif ratio < LOWER_RATIO_BOUND: + return False + elif kb.matchRatio is None: return None