@@ -1075,33 +1075,33 @@ def _randomizeParameter(paramString, randomParameter):
10751075 if kb .postHint in (POST_HINT .XML , POST_HINT .SOAP ):
10761076 if re .search (r"<%s\b" % re .escape (name ), post ):
10771077 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 )
10791079 elif re .search (r"\b%s>" % re .escape (name ), post ):
10801080 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 )
10821082
10831083 regex = r"\b(%s)\b([^\w]+)(\w+)" % re .escape (name )
10841084 if not found and re .search (regex , (post or "" )):
10851085 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 )
10871087
10881088 regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re .escape (delimiter ), re .escape (name ), re .escape (delimiter ))
10891089 if not found and re .search (regex , (post or "" )):
10901090 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 )
10921092
10931093 if re .search (regex , (get or "" )):
10941094 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 )
10961096
10971097 if re .search (regex , (query or "" )):
10981098 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 )
11001100
11011101 regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re .escape (conf .cookieDel or DEFAULT_COOKIE_DELIMITER ), name , re .escape (conf .cookieDel or DEFAULT_COOKIE_DELIMITER ))
11021102 if re .search (regex , (cookie or "" )):
11031103 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 )
11051105
11061106 if not found :
11071107 if post is not None :
0 commit comments