layout adjustment

This commit is contained in:
Bernardo Damele 2011-04-30 15:22:33 +00:00
parent 9a4ae7d9e2
commit 00f14bec5f

View File

@ -1357,6 +1357,7 @@ def safeStringFormat(formatStr, params):
retVal = retVal[:index] + getUnicode(params[count]) + retVal[index+2:] retVal = retVal[:index] + getUnicode(params[count]) + retVal[index+2:]
else: else:
raise sqlmapNoneDataException, "wrong number of parameters during string formatting" raise sqlmapNoneDataException, "wrong number of parameters during string formatting"
count += 1 count += 1
return retVal return retVal
@ -1364,10 +1365,12 @@ def safeStringFormat(formatStr, params):
def sanitizeAsciiString(subject): def sanitizeAsciiString(subject):
if subject: if subject:
index = None index = None
for i in xrange(len(subject)): for i in xrange(len(subject)):
if ord(subject[i]) >= 128: if ord(subject[i]) >= 128:
index = i index = i
break break
if index is None: if index is None:
return subject return subject
else: else:
@ -1380,6 +1383,7 @@ def getFilteredPageContent(page, onlyText=True):
if isinstance(page, basestring): if isinstance(page, basestring):
retVal = re.sub(r"(?s)<script.+?</script>|<!--.+?-->|<style.+?</style>%s" % (r"|<[^>]+>|\t|\n|\r" if onlyText else ""), " ", page) retVal = re.sub(r"(?s)<script.+?</script>|<!--.+?-->|<style.+?</style>%s" % (r"|<[^>]+>|\t|\n|\r" if onlyText else ""), " ", page)
while retVal.find(" ") != -1: while retVal.find(" ") != -1:
retVal = retVal.replace(" ", " ") retVal = retVal.replace(" ", " ")