mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
Fixing thread-safety in getHeuristicCharEncoding
This commit is contained in:
parent
603295e68d
commit
2e00154e38
4 changed files with 10 additions and 7 deletions
|
|
@ -259,8 +259,11 @@ def getHeuristicCharEncoding(page):
|
|||
"""
|
||||
|
||||
key = (len(page), hash(page))
|
||||
retVal = kb.cache.encoding[key] if key in kb.cache.encoding else detect(page[:HEURISTIC_PAGE_SIZE_THRESHOLD])["encoding"]
|
||||
kb.cache.encoding[key] = retVal
|
||||
|
||||
retVal = kb.cache.encoding.get(key)
|
||||
if retVal is None:
|
||||
retVal = detect(page[:HEURISTIC_PAGE_SIZE_THRESHOLD])["encoding"]
|
||||
kb.cache.encoding[key] = retVal
|
||||
|
||||
if retVal and retVal.lower().replace('-', "") == UNICODE_ENCODING.lower().replace('-', ""):
|
||||
infoMsg = "heuristics detected web page charset '%s'" % retVal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue