Skip to content

Commit 06761e4

Browse files
committed
Fixed: __WinHttpNormalizeForm might scramble form rendering it invalid.
1 parent 5effd27 commit 06761e4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

WinHttp.au3

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,23 +2220,29 @@ EndFunc
22202220

22212221
Func __WinHttpNormalizeForm(ByRef $sForm, $sSpr1, $sSpr2)
22222222
Local $aData = StringToASCIIArray($sForm, Default, Default, 2)
2223-
Local $sOut, $bQuot = False, $bSQuot = False
2223+
Local $sOut, $bQuot = False, $bSQuot = False, $bOpTg = True
22242224
For $i = 0 To UBound($aData) - 1
22252225
Switch $aData[$i]
22262226
Case 34
2227-
$bQuot = Not $bQuot
2227+
If $bOpTg Then $bQuot = Not $bQuot
2228+
$sOut &= Chr($aData[$i])
22282229
Case 39
2229-
$bSQuot = Not $bSQuot
2230+
If $bOpTg Then $bSQuot = Not $bSQuot
2231+
$sOut &= Chr($aData[$i])
22302232
Case 32 ; space
22312233
If $bQuot Or $bSQuot Then
22322234
$sOut &= $sSpr1
22332235
Else
22342236
$sOut &= Chr($aData[$i])
22352237
EndIf
2238+
Case 60 ; <
2239+
If Not $bOpTg Then $bOpTg = True
2240+
$sOut &= Chr($aData[$i])
22362241
Case 62 ; >
22372242
If $bQuot Or $bSQuot Then
22382243
$sOut &= $sSpr2
22392244
Else
2245+
If $bOpTg Then $bOpTg = False
22402246
$sOut &= Chr($aData[$i])
22412247
EndIf
22422248
Case Else

0 commit comments

Comments
 (0)