mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-03 22:31:34 +00:00
introducing regex caching mechanism
This commit is contained in:
parent
14cab8527e
commit
5d5ebd49b6
4 changed files with 24 additions and 10 deletions
|
|
@ -70,6 +70,8 @@ from lib.core.settings import SQLITE_ALIASES
|
|||
from lib.core.settings import ACCESS_ALIASES
|
||||
from lib.core.settings import FIREBIRD_ALIASES
|
||||
|
||||
__compiledRegularExpressions = {}
|
||||
|
||||
def paramToDict(place, parameters=None):
|
||||
"""
|
||||
Split the parameters into names and values, check if these parameters
|
||||
|
|
@ -1222,3 +1224,11 @@ def getGoodSamaritanCharsets(part, prevValue, originalCharset):
|
|||
return predictedCharset, otherCharset
|
||||
else:
|
||||
return None, originalTable
|
||||
|
||||
def getCompiledRegex(regex):
|
||||
if regex in __compiledRegularExpressions:
|
||||
return __compiledRegularExpressions[regex]
|
||||
else:
|
||||
retVal = re.compile(regex)
|
||||
__compiledRegularExpressions[regex] = retVal
|
||||
return retVal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue