minor update regarding good samaritan

This commit is contained in:
Miroslav Stampar 2010-05-25 14:51:02 +00:00
parent 065d5b02ec
commit 8ed76b3024
2 changed files with 12 additions and 7 deletions

View File

@ -1264,9 +1264,9 @@ def getGoodSamaritanParameters(part, prevValue, originalCharset):
predictedCharset.sort()
if len(predictedCharset) > 1:
singleValue = None
return singleValue, predictedCharset, otherCharset
return None, predictedCharset, otherCharset
else:
return singleValue, None, originalCharset
else:
return None, None, originalCharset

View File

@ -371,13 +371,18 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
if conf.useCommonPrediction:
singleValue, predictedCharset, otherCharset = getGoodSamaritanParameters(kb.partRun, finalValue, asciiTbl)
val = None
if singleValue is None:
val = getChar(index, predictedCharset, False) if predictedCharset else None
else:
##check if that's the value
#finalValue = singleValue
#break
#forgedPayload = safeStringFormat('AND (%s) = \'%s\'', (expressionUnescaped, singleValue))
#result = Request.queryPage(urlencode(forgedPayload))
#if result:
# finalValue = singleValue
# break
pass
if not val:
val = getChar(index, otherCharset)
else: