@@ -1959,7 +1959,7 @@ def findMultipartPostBoundary(post):
19591959
19601960 return retVal
19611961
1962- def urldecode (value , encoding = None , unsafe = "%%&=;+%s" % CUSTOM_INJECTION_MARK_CHAR , convall = False ):
1962+ def urldecode (value , encoding = None , unsafe = "%%&=;+%s" % CUSTOM_INJECTION_MARK_CHAR , convall = False , plusspace = True ):
19631963 result = value
19641964
19651965 if value :
@@ -1977,14 +1977,16 @@ def _(match):
19771977 char = chr (ord (match .group (1 ).decode ("hex" )))
19781978 return char if char in charset else match .group (0 )
19791979 result = re .sub ("%([0-9a-fA-F]{2})" , _ , value )
1980- result = result .replace ("+" , " " ) # plus sign has a special meaning in url encoded data (hence the usage of urllib.unquote_plus in convall case)
1980+
1981+ if plusspace :
1982+ result = result .replace ("+" , " " ) # plus sign has a special meaning in url encoded data (hence the usage of urllib.unquote_plus in convall case)
19811983
19821984 if isinstance (result , str ):
19831985 result = unicode (result , encoding or UNICODE_ENCODING , "replace" )
19841986
19851987 return result
19861988
1987- def urlencode (value , safe = "%&=" , convall = False , limit = False ):
1989+ def urlencode (value , safe = "%&=" , convall = False , limit = False , spaceplus = False ):
19881990 if conf .direct :
19891991 return value
19901992
@@ -2016,6 +2018,9 @@ def urlencode(value, safe="%&=", convall=False, limit=False):
20162018 else :
20172019 break
20182020
2021+ if spaceplus :
2022+ result = result .replace (urllib .quote (' ' ), '+' )
2023+
20192024 return result
20202025
20212026def runningAsAdmin ():
@@ -2996,7 +3001,7 @@ def geturl(self):
29963001 url = urldecode (request .get_full_url (), kb .pageEncoding )
29973002 method = request .get_method ()
29983003 data = request .get_data () if request .has_data () else None
2999- data = urldecode (data , kb .pageEncoding ) if data and urlencode ( DEFAULT_GET_POST_DELIMITER , None ) not in data else data
3004+ data = urldecode (data , kb .pageEncoding , plusspace = False )
30003005
30013006 if not data and method and method .upper () == HTTPMETHOD .POST :
30023007 debugMsg = "invalid POST form with blank data detected"
0 commit comments