Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e836629

Browse files
committed
Bug fixes for search (safeStringFormat should not replace all if given scalar values)
1 parent 31230c5 commit e836629

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,9 +1374,9 @@ def safeStringFormat(format_, params):
13741374
retVal = format_.replace("%d", "%s")
13751375

13761376
if isinstance(params, basestring):
1377-
retVal = retVal.replace("%s", params)
1377+
retVal = retVal.replace("%s", params, 1)
13781378
elif not isListLike(params):
1379-
retVal = retVal.replace("%s", str(params))
1379+
retVal = retVal.replace("%s", str(params), 1)
13801380
else:
13811381
count, index = 0, 0
13821382
while index != -1:

plugins/generic/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def searchTable(self):
314314
query = agent.limitQuery(index, query)
315315

316316
foundTbl = unArrayizeValue(inject.getValue(query, union=False, error=False))
317-
if not isNoneValue(foundTbls[db]):
317+
if not isNoneValue(foundTbl):
318318
kb.hintValue = foundTbl
319319
foundTbl = safeSQLIdentificatorNaming(foundTbl, True)
320320
foundTbls[db].append(foundTbl)

0 commit comments

Comments
 (0)