Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d62195

Browse files
committed
Minor update of testing
1 parent 8ace336 commit 5d62195

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.1.2"
21+
VERSION = "1.4.1.3"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/testing.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ def smokeTest():
192192

193193
dirtyPatchRandom()
194194

195+
content = open(paths.ERRORS_XML, "r").read()
196+
for regex in re.findall(r'<error regexp="(.+?)"/>', content):
197+
try:
198+
re.compile(regex)
199+
except re.error:
200+
errMsg = "smoke test failed at compiling '%s'" % regex
201+
logger.error(errMsg)
202+
return False
203+
195204
retVal = True
196205
count, length = 0, 0
197206

lib/parse/html.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ def htmlParser(page):
5757
"""
5858
This function calls a class that parses the input HTML page to
5959
fingerprint the back-end database management system
60+
61+
>>> from lib.core.enums import DBMS
62+
>>> htmlParser("Warning: mysql_fetch_array() expects parameter 1 to be resource") == DBMS.MYSQL
63+
True
64+
>>> threadData = getCurrentThreadData()
65+
>>> threadData.lastErrorPage = None
6066
"""
6167

6268
xmlfile = paths.ERRORS_XML

0 commit comments

Comments
 (0)