@@ -1075,33 +1075,33 @@ def _randomizeParameter(paramString, randomParameter):
1075
1075
if kb .postHint in (POST_HINT .XML , POST_HINT .SOAP ):
1076
1076
if re .search (r"<%s\b" % re .escape (name ), post ):
1077
1077
found = True
1078
- post = re .sub (r"(?s)(<%s\b[^>]*>)(.*?)(</%s)" % (re .escape (name ), re .escape (name )), "\g<1>%s\g<3>" % value , post )
1078
+ post = re .sub (r"(?s)(<%s\b[^>]*>)(.*?)(</%s)" % (re .escape (name ), re .escape (name )), "\g<1>%s\g<3>" % value . replace ( ' \\ ' , r'\\' ) , post )
1079
1079
elif re .search (r"\b%s>" % re .escape (name ), post ):
1080
1080
found = True
1081
- post = re .sub (r"(?s)(\b%s>)(.*?)(</[^<]*\b%s>)" % (re .escape (name ), re .escape (name )), "\g<1>%s\g<3>" % value , post )
1081
+ post = re .sub (r"(?s)(\b%s>)(.*?)(</[^<]*\b%s>)" % (re .escape (name ), re .escape (name )), "\g<1>%s\g<3>" % value . replace ( ' \\ ' , r'\\' ) , post )
1082
1082
1083
1083
regex = r"\b(%s)\b([^\w]+)(\w+)" % re .escape (name )
1084
1084
if not found and re .search (regex , (post or "" )):
1085
1085
found = True
1086
- post = re .sub (regex , "\g<1>\g<2>%s" % value , post )
1086
+ post = re .sub (regex , "\g<1>\g<2>%s" % value . replace ( ' \\ ' , r'\\' ) , post )
1087
1087
1088
1088
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re .escape (delimiter ), re .escape (name ), re .escape (delimiter ))
1089
1089
if not found and re .search (regex , (post or "" )):
1090
1090
found = True
1091
- post = re .sub (regex , "\g<1>%s\g<3>" % value , post )
1091
+ post = re .sub (regex , "\g<1>%s\g<3>" % value . replace ( ' \\ ' , r'\\' ) , post )
1092
1092
1093
1093
if re .search (regex , (get or "" )):
1094
1094
found = True
1095
- get = re .sub (regex , "\g<1>%s\g<3>" % value , get )
1095
+ get = re .sub (regex , "\g<1>%s\g<3>" % value . replace ( ' \\ ' , r'\\' ) , get )
1096
1096
1097
1097
if re .search (regex , (query or "" )):
1098
1098
found = True
1099
- uri = re .sub (regex .replace (r"\A" , r"\?" ), "\g<1>%s\g<3>" % value , uri )
1099
+ uri = re .sub (regex .replace (r"\A" , r"\?" ), "\g<1>%s\g<3>" % value . replace ( ' \\ ' , r'\\' ) , uri )
1100
1100
1101
1101
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re .escape (conf .cookieDel or DEFAULT_COOKIE_DELIMITER ), name , re .escape (conf .cookieDel or DEFAULT_COOKIE_DELIMITER ))
1102
1102
if re .search (regex , (cookie or "" )):
1103
1103
found = True
1104
- cookie = re .sub (regex , "\g<1>%s\g<3>" % value , cookie )
1104
+ cookie = re .sub (regex , "\g<1>%s\g<3>" % value . replace ( ' \\ ' , r'\\' ) , cookie )
1105
1105
1106
1106
if not found :
1107
1107
if post is not None :
0 commit comments