mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-06-10 02:01:57 +00:00
Minor adjustments
This commit is contained in:
parent
1a764e1f08
commit
4ce3abc56d
3 changed files with 24 additions and 21 deletions
|
|
@ -840,7 +840,7 @@ def directoryPath(path):
|
|||
else:
|
||||
retVal = ntpath.dirname(path)
|
||||
return retVal
|
||||
|
||||
|
||||
def normalizePath(path):
|
||||
retVal = None
|
||||
if path.find('/') != -1:
|
||||
|
|
@ -850,18 +850,22 @@ def normalizePath(path):
|
|||
return retVal
|
||||
|
||||
def safeStringFormat(formatStr, params):
|
||||
index = 0
|
||||
count = 0
|
||||
|
||||
retVal = formatStr.replace('%d', '%s')
|
||||
|
||||
while index !=- 1:
|
||||
index = retVal.find('%s')
|
||||
if index != -1:
|
||||
if count < len(params):
|
||||
retVal = retVal[:index] + str(params[count]) + retVal[index+2:]
|
||||
else:
|
||||
raise sqlmapNoneDataException, "wrong number of parameters during string formatting"
|
||||
count += 1
|
||||
|
||||
|
||||
if isinstance(params, str):
|
||||
retVal = retVal.replace("%s", params)
|
||||
else:
|
||||
count = 0
|
||||
index = 0
|
||||
|
||||
while index != -1:
|
||||
index = retVal.find('%s')
|
||||
|
||||
if index != -1:
|
||||
if count < len(params):
|
||||
retVal = retVal[:index] + str(params[count]) + retVal[index+2:]
|
||||
else:
|
||||
raise sqlmapNoneDataException, "wrong number of parameters during string formatting"
|
||||
count += 1
|
||||
|
||||
return retVal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue