mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 06:01:29 +00:00
Minor update
This commit is contained in:
@@ -1118,6 +1118,13 @@ def sanitizeStr(value):
|
||||
return getUnicode(value).replace("\n", " ").replace("\r", "")
|
||||
|
||||
def getHeader(headers, key):
|
||||
"""
|
||||
Returns header value ignoring the letter case
|
||||
|
||||
>>> getHeader({"Foo": "bar"}, "foo")
|
||||
'bar'
|
||||
"""
|
||||
|
||||
retVal = None
|
||||
for _ in (headers or {}):
|
||||
if _.upper() == key.upper():
|
||||
@@ -1619,6 +1626,13 @@ def getRemoteIP():
|
||||
return retVal
|
||||
|
||||
def getFileType(filePath):
|
||||
"""
|
||||
Returns "magic" file type for given file path
|
||||
|
||||
>>> getFileType(__file__)
|
||||
'text'
|
||||
"""
|
||||
|
||||
try:
|
||||
_ = magic.from_file(filePath)
|
||||
except:
|
||||
@@ -4387,6 +4401,9 @@ def getSafeExString(ex, encoding=None):
|
||||
"""
|
||||
Safe way how to get the proper exception represtation as a string
|
||||
(Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161'))
|
||||
|
||||
>>> getSafeExString(Exception('foobar'))
|
||||
u'foobar'
|
||||
"""
|
||||
|
||||
retVal = ex
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||
from lib.core.enums import OS
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.1.7.9"
|
||||
VERSION = "1.1.7.10"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
||||
Reference in New Issue
Block a user