Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddfec1c commit 2ab4558Copy full SHA for 2ab4558
1 file changed
lib/core/common.py
@@ -1520,10 +1520,10 @@ def safeStringFormat(format_, params):
1520
1521
if format_.count(PAYLOAD_DELIMITER) == 2:
1522
_ = format_.split(PAYLOAD_DELIMITER)
1523
- _[1] = _[1].replace("%d", "%s")
+ _[1] = re.sub(r"(\A|[^A-Za-z0-9])(%d)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>", _[1])
1524
retVal = PAYLOAD_DELIMITER.join(_)
1525
else:
1526
- retVal = format_.replace("%d", "%s")
+ retVal = re.sub(r"(\A|[^A-Za-z0-9])(%d)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>", format_)
1527
1528
if isinstance(params, basestring):
1529
retVal = retVal.replace("%s", params, 1)
0 commit comments