|
29 | 29 | from lib.core.threads import getCurrentThreadData |
30 | 30 |
|
31 | 31 | def comparison(page, headers, code=None, getRatioValue=False, pageLength=None): |
32 | | - return _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue) |
| 32 | + _ = _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue) |
| 33 | + return _ |
33 | 34 |
|
34 | 35 | def _adjust(condition, getRatioValue): |
35 | 36 | if not any([conf.string, conf.regexp, conf.code]): |
36 | 37 | # Negative logic approach is used in raw page comparison scheme as that what is "different" than original |
37 | 38 | # PAYLOAD.WHERE.NEGATIVE response is considered as True; in switch based approach negative logic is not |
38 | 39 | # applied as that what is by user considered as True is that what is returned by the comparison mechanism |
39 | 40 | # itself |
40 | | - retVal = not (condition or False) if kb.negativeLogic else condition |
| 41 | + retVal = not condition if kb.negativeLogic and condition is not None else condition |
41 | 42 | else: |
42 | 43 | retVal = condition if not getRatioValue else (MAX_RATIO if condition else MIN_RATIO) |
43 | 44 |
|
@@ -67,7 +68,7 @@ def _comparison(page, headers, code, getRatioValue, pageLength): |
67 | 68 |
|
68 | 69 | if page: |
69 | 70 | # In case of an DBMS error page return None |
70 | | - if not kb.negativeLogic and kb.errorIsNone and (wasLastRequestDBMSError() or wasLastRequestHTTPError()): |
| 71 | + if kb.errorIsNone and (wasLastRequestDBMSError() or wasLastRequestHTTPError()): |
71 | 72 | return None |
72 | 73 |
|
73 | 74 | # Dynamic content lines to be excluded before comparison |
|
0 commit comments