mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue