-Fixed bad BSON when writing long strings of complex UTF8 characters

-Fixed error not being raised for additional content in JSON string for JArray.Parse and JObject.Parse
This commit is contained in:
JamesNK
2011-11-19 03:16:04 +00:00
parent 5831b11de1
commit 9ef17d05a3
13 changed files with 100 additions and 19 deletions
+6 -1
View File
@@ -1229,7 +1229,12 @@ namespace Newtonsoft.Json.Linq
{
JsonReader jsonReader = new JsonTextReader(new StringReader(json));
return Load(jsonReader);
JToken t = Load(jsonReader);
if (jsonReader.Read() && jsonReader.TokenType != JsonToken.Comment)
throw new Exception("Additional text found in JSON string after parsing content.");
return t;
}
/// <summary>