@@ -1224,13 +1224,14 @@ Func _WinHttpSimpleFormFill(ByRef $hInternet, $sActionPage = Default, $sFormId =
1224
1224
__WinHttpNormalizeActionURL($sActionPage , $sAction , $iScheme , $sNewURL , $sEnctype , $sMethod , $sURL )
1225
1225
If $fVarForm And Not $sNewURL Then Return SetError (5 , 0 , " " ) ; "action" must have URL specified
1226
1226
Local $aSplit , $sBoundary , $sPassedId , $sPassedData , $iNumRepl , $fMultiPart = False , $sSubmit , $sRadio , $sCheckBox , $sButton
1227
- Local $sGrSep = Chr (29 )
1227
+ Local $sGrSep = Chr (29 ), $iErr
1228
1228
Local $aInputIds [4 ][UBound ($aInput )]
1229
1229
Switch $sEnctype
1230
1230
Case " " , " application/x-www-form-urlencoded" , " text/plain"
1231
1231
For $i = 0 To UBound ($aInput ) - 1 ; for all input elements
1232
1232
__WinHttpFormAttrib($aInputIds , $i , $aInput [$i ])
1233
1233
If $aInputIds [1 ][$i ] Then ; if there is 'name' field then add it
1234
+ $aInputIds [1 ][$i ] = __WinHttpURLEncode($aInputIds [1 ][$i ], $sEnctype )
1234
1235
$aInputIds [2 ][$i ] = __WinHttpURLEncode($aInputIds [2 ][$i ], $sEnctype )
1235
1236
$sAddData &= $aInputIds [1 ][$i ] & " =" & $aInputIds [2 ][$i ] & " &"
1236
1237
If $aInputIds [3 ][$i ] = " submit" Then $sSubmit &= $aInputIds [1 ][$i ] & " =" & $aInputIds [2 ][$i ] & $sGrSep ; add to overall "submit" string
@@ -1250,8 +1251,11 @@ Func _WinHttpSimpleFormFill(ByRef $hInternet, $sActionPage = Default, $sFormId =
1250
1251
$sPassedId = $aFlds [$k ]
1251
1252
$aFlds [$k ] = 0
1252
1253
$aSplit = StringSplit ($sPassedId , " :" , 2 )
1253
- If @error Or $aSplit [0 ] <> " name" Then ; like .getElementById
1254
- If Not @error And $aSplit [0 ] = " id" Then $sPassedId = $aSplit [1 ]
1254
+ $iErr = @error
1255
+ $aSplit [0 ] = __WinHttpURLEncode($aSplit [0 ], $sEnctype )
1256
+ If Not $iErr Then $aSplit [1 ] = __WinHttpURLEncode($aSplit [1 ], $sEnctype )
1257
+ If $iErr Or $aSplit [0 ] <> " name" Then ; like .getElementById
1258
+ If Not $iErr And $aSplit [0 ] = " id" Then $sPassedId = $aSplit [1 ]
1255
1259
For $j = 0 To UBound ($aInputIds , 2 ) - 1
1256
1260
If $aInputIds [0 ][$j ] = $sPassedId Then
1257
1261
If $aInputIds [3 ][$j ] = " submit" Then
0 commit comments