Skip to content

Commit 3620d36

Browse files
committed
- Updated Newtonsoft.Json to fix security issues
- Changed TargetFrameworks to only netstandard2.0 - Integrated original Pull-Request IG-Group#22 to fix localization issues
1 parent e8f0f31 commit 3620d36

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

IGWebApiClient/IGStreamingApi.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45
using System.Text;
56
using com.lightstreamer.client;
@@ -114,43 +115,43 @@ public L1LsPriceData L1LsPriceUpdateData(ItemUpdate update)
114115

115116
if (!string.IsNullOrEmpty(midOpen))
116117
{
117-
lsL1PriceData.MidOpen = Convert.ToDecimal(midOpen);
118+
lsL1PriceData.MidOpen = Convert.ToDecimal(midOpen, CultureInfo.InvariantCulture);
118119
}
119120
if (!string.IsNullOrEmpty(high))
120121
{
121-
lsL1PriceData.High = Convert.ToDecimal(high);
122+
lsL1PriceData.High = Convert.ToDecimal(high, CultureInfo.InvariantCulture);
122123
}
123124
if (!string.IsNullOrEmpty(low))
124125
{
125-
lsL1PriceData.Low = Convert.ToDecimal(low);
126+
lsL1PriceData.Low = Convert.ToDecimal(low, CultureInfo.InvariantCulture);
126127
}
127128
if (!string.IsNullOrEmpty(change))
128129
{
129-
lsL1PriceData.Change = Convert.ToDecimal(change);
130+
lsL1PriceData.Change = Convert.ToDecimal(change, CultureInfo.InvariantCulture);
130131
}
131132
if (!string.IsNullOrEmpty(changePct))
132133
{
133-
lsL1PriceData.ChangePct = Convert.ToDecimal(changePct);
134+
lsL1PriceData.ChangePct = Convert.ToDecimal(changePct, CultureInfo.InvariantCulture);
134135
}
135136
if (!string.IsNullOrEmpty(updateTime))
136137
{
137138
lsL1PriceData.UpdateTime = updateTime;
138139
}
139140
if (!string.IsNullOrEmpty(marketDelay))
140141
{
141-
lsL1PriceData.MarketDelay = Convert.ToInt32(marketDelay);
142+
lsL1PriceData.MarketDelay = Convert.ToInt32(marketDelay, CultureInfo.InvariantCulture);
142143
}
143144
if (!string.IsNullOrEmpty(marketState))
144145
{
145146
lsL1PriceData.MarketState = marketState;
146147
}
147148
if (!string.IsNullOrEmpty(bid))
148149
{
149-
lsL1PriceData.Bid = Convert.ToDecimal(bid);
150+
lsL1PriceData.Bid = Convert.ToDecimal(bid, CultureInfo.InvariantCulture);
150151
}
151152
if (!string.IsNullOrEmpty(offer))
152153
{
153-
lsL1PriceData.Offer = Convert.ToDecimal(offer);
154+
lsL1PriceData.Offer = Convert.ToDecimal(offer, CultureInfo.InvariantCulture);
154155
}
155156
}
156157
catch (Exception)
@@ -172,23 +173,23 @@ public StreamingAccountData StreamingAccountDataUpdates(ItemUpdate update)
172173

173174
if (!string.IsNullOrEmpty(pnl))
174175
{
175-
streamingAccountData.ProfitAndLoss = Convert.ToDecimal(pnl);
176+
streamingAccountData.ProfitAndLoss = Convert.ToDecimal(pnl, CultureInfo.InvariantCulture);
176177
}
177178
if (!string.IsNullOrEmpty(deposit))
178179
{
179-
streamingAccountData.Deposit = Convert.ToDecimal(deposit);
180+
streamingAccountData.Deposit = Convert.ToDecimal(deposit, CultureInfo.InvariantCulture);
180181
}
181182
if (!string.IsNullOrEmpty(usedMargin))
182183
{
183-
streamingAccountData.UsedMargin = Convert.ToDecimal(usedMargin);
184+
streamingAccountData.UsedMargin = Convert.ToDecimal(usedMargin, CultureInfo.InvariantCulture);
184185
}
185186
if (!string.IsNullOrEmpty(amountDue))
186187
{
187-
streamingAccountData.AmountDue = Convert.ToDecimal(amountDue);
188+
streamingAccountData.AmountDue = Convert.ToDecimal(amountDue, CultureInfo.InvariantCulture);
188189
}
189190
if (!string.IsNullOrEmpty(availableCash))
190191
{
191-
streamingAccountData.AmountDue = Convert.ToDecimal(availableCash);
192+
streamingAccountData.AmountDue = Convert.ToDecimal(availableCash, CultureInfo.InvariantCulture);
192193
}
193194

194195
}

IGWebApiClient/IGWebApiClient.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net48;netstandard2.0</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
44
<SccProjectName>SAK</SccProjectName>
55
<SccLocalPath>SAK</SccLocalPath>
66
<SccAuxPath>SAK</SccAuxPath>
@@ -13,11 +13,11 @@
1313
<AssemblyVersion>2.0.0.0</AssemblyVersion>
1414
<FileVersion>2.0.0.0</FileVersion>
1515
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
16-
<Version>2.0.0-beta-2</Version>
16+
<Version>2.0.0-beta-3</Version>
1717
</PropertyGroup>
1818
<ItemGroup>
1919
<PackageReference Include="Lightstreamer.DotNetStandard.Client" Version="5.0.5" />
2020
<PackageReference Include="System.Net.Http" Version="4.3.4" />
21-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
21+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
2222
</ItemGroup>
2323
</Project>

SampleWPFTrader/SampleWPFTrader.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PackageReference Include="CommonServiceLocator" Version="2.0.6" />
2121
<PackageReference Include="Microsoft.Net.Http" Version="2.2.29" />
2222
<PackageReference Include="MvvmLightLibs" Version="5.4.1.1" />
23-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
23+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
2424
<PackageReference Include="Lightstreamer.DotNetStandard.Client" Version="5.0.5" />
2525
</ItemGroup>
2626
<ItemGroup>

0 commit comments

Comments
 (0)