|
21 | 21 | from lib.core.data import kb |
22 | 22 | from lib.core.data import logger |
23 | 23 | from lib.core.exception import SqlmapNoneDataException |
24 | | -from lib.core.exception import SqlmapSilentQuitException |
25 | 24 | from lib.core.settings import DEFAULT_PAGE_ENCODING |
26 | | -from lib.core.settings import DEV_EMAIL_ADDRESS |
27 | 25 | from lib.core.settings import DIFF_TOLERANCE |
28 | 26 | from lib.core.settings import HTML_TITLE_REGEX |
29 | 27 | from lib.core.settings import LOWER_RATIO_BOUND |
|
37 | 35 | from thirdparty import six |
38 | 36 |
|
39 | 37 | def comparison(page, headers, code=None, getRatioValue=False, pageLength=None): |
40 | | - try: |
41 | | - _ = _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue) |
42 | | - return _ |
43 | | - except: |
44 | | - warnMsg = "there was a KNOWN issue inside the internals regarding the difflib/comparison of pages. " |
45 | | - warnMsg += "Please report details privately via e-mail to '%s'" % DEV_EMAIL_ADDRESS |
46 | | - logger.critical(warnMsg) |
47 | | - raise SqlmapSilentQuitException |
| 38 | + if not isinstance(page, (six.text_type, six.binary_type, type(None))): |
| 39 | + logger.critical("got page of type %s; repr(page)[:200]=%s" % (type(page), repr(page)[:200])) |
| 40 | + |
| 41 | + try: |
| 42 | + page = b"".join(page) |
| 43 | + except: |
| 44 | + page = six.text_type(page) |
| 45 | + |
| 46 | + _ = _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue) |
| 47 | + return _ |
48 | 48 |
|
49 | 49 | def _adjust(condition, getRatioValue): |
50 | 50 | if not any((conf.string, conf.notString, conf.regexp, conf.code)): |
|
0 commit comments