@@ -1239,11 +1239,11 @@ Func _WinHttpSimpleFormFill(ByRef $hInternet, $sActionPage = Default, $sFormId =
1239
1239
If @error Then Return SetError (2 , 0 , " " ) ; invalid form
1240
1240
Local $aInputIds [4 ][UBound ($aInput )]
1241
1241
Switch $sEnctype
1242
- Case " " , " application/x-www-form-urlencoded"
1242
+ Case " " , " application/x-www-form-urlencoded" , " text/plain "
1243
1243
For $i = 0 To UBound ($aInput ) - 1 ; for all input elements
1244
1244
__WinHttpFormAttrib($aInputIds , $i , $aInput [$i ])
1245
1245
If $aInputIds [1 ][$i ] Then ; if there is 'name' field then add it
1246
- $aInputIds [2 ][$i ] = __WinHttpURLEncode($aInputIds [2 ][$i ])
1246
+ $aInputIds [2 ][$i ] = __WinHttpURLEncode($aInputIds [2 ][$i ], $sEnctype )
1247
1247
$sAddData &= $aInputIds [1 ][$i ] & " =" & $aInputIds [2 ][$i ] & " &"
1248
1248
If $aInputIds [3 ][$i ] = " submit" Then $sSubmit &= $aInputIds [1 ][$i ] & " =" & $aInputIds [2 ][$i ] & $sGrSep ; add to overall "submit" string
1249
1249
If $aInputIds [3 ][$i ] = " radio" Then $sRadio &= $aInputIds [1 ][$i ] & " =" & $aInputIds [2 ][$i ] & $sGrSep ; add to overall "radio" string
@@ -1257,7 +1257,7 @@ Func _WinHttpSimpleFormFill(ByRef $hInternet, $sActionPage = Default, $sFormId =
1257
1257
$sButton = StringTrimRight ($sButton , 1 )
1258
1258
$sAddData = StringTrimRight ($sAddData , 1 )
1259
1259
For $k = 1 To $iNumParams
1260
- $sPassedData = __WinHttpURLEncode($aDtas [$k ])
1260
+ $sPassedData = __WinHttpURLEncode($aDtas [$k ], $sEnctype )
1261
1261
$aDtas [$k ] = 0
1262
1262
$sPassedId = $aFlds [$k ]
1263
1263
$aFlds [$k ] = 0
@@ -2003,9 +2003,10 @@ Func __WinHttpCharSet($sContentType)
2003
2003
If $sContentType = " utf-8" Then Return 65001
2004
2004
EndFunc
2005
2005
2006
- Func __WinHttpURLEncode($vData )
2006
+ Func __WinHttpURLEncode($vData , $sEncType = " " )
2007
2007
If IsBool ($vData ) Then Return $vData
2008
2008
$vData = __WinHttpHTMLDecode($vData )
2009
+ If $sEnctype = " text/plain" Then Return StringReplace ($vData , " " , " +" )
2009
2010
Local $aData = StringToASCIIArray ($vData , Default , Default , 2 )
2010
2011
Local $sOut
2011
2012
For $i = 0 To UBound ($aData ) - 1
0 commit comments