mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-08 22:28:14 +00:00
Minor optimization of prioritySortColumns
This commit is contained in:
parent
fcd3eae668
commit
b54929af28
3 changed files with 8 additions and 6 deletions
|
|
@ -5176,10 +5176,12 @@ def prioritySortColumns(columns):
|
|||
['id', 'userid', 'name', 'password']
|
||||
"""
|
||||
|
||||
def _(column):
|
||||
return column and re.search(r"^id|id$", column, re.I) is not None
|
||||
recompile = re.compile(r"^id|id$", re.I)
|
||||
|
||||
return sorted(sorted(columns, key=len), key=functools.cmp_to_key(lambda x, y: -1 if _(x) and not _(y) else 1 if not _(x) and _(y) else 0))
|
||||
return sorted(columns, key=lambda col: (
|
||||
not (col and recompile.search(col)),
|
||||
len(col)
|
||||
))
|
||||
|
||||
def getRequestHeader(request, name):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.1.70"
|
||||
VERSION = "1.10.1.71"
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue