-Fixed not parsing some ISO date timezones

-Fixed float schema validation of integer values
-Changed writing of IConvertible values to convert objects to strings
-Fixed serializing proxy objects with no default constructor
This commit is contained in:
James Newton-King
2013-10-04 22:29:32 +13:00
parent e77fdf285b
commit 107d15a38d
10 changed files with 163 additions and 18 deletions
@@ -176,26 +176,47 @@ namespace Newtonsoft.Json.Utilities
}
else
{
if (start + 5 < _length
if (start + 2 < _length
&& Parse2Digit(start + Lz_, out ZoneHour)
&& ZoneHour <= 99
&& ParseChar(start + Lz_zz, ':')
&& Parse2Digit(start + Lz_zz_, out ZoneMinute)
&& ZoneMinute <= 99)
&& ZoneHour <= 99)
{
switch (ch)
{
case '-':
Zone = ParserTimeZone.LocalWestOfUtc;
start += Lz_zz_zz;
start += Lz_zz;
break;
case '+':
Zone = ParserTimeZone.LocalEastOfUtc;
start += Lz_zz_zz;
start += Lz_zz;
break;
}
}
if (start < _length)
{
if (ParseChar(start, ':'))
{
start += 1;
if (start + 1 < _length
&& Parse2Digit(start, out ZoneMinute)
&& ZoneMinute <= 99)
{
start += 2;
}
}
else
{
if (start + 1 < _length
&& Parse2Digit(start, out ZoneMinute)
&& ZoneMinute <= 99)
{
start += 2;
}
}
}
}
}