From d4ee171e017ee23121c7de9153bf5555156895af Mon Sep 17 00:00:00 2001 From: Aptivi Date: Thu, 4 Apr 2024 13:56:29 +0300 Subject: [PATCH] add - Allowed all X-nonstandard types --- We've allowed all X-nonstandard types. --- Type: add Breaking: False Doc Required: False Part: 1/1 --- VisualCard/Parsers/VcardParser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VisualCard/Parsers/VcardParser.cs b/VisualCard/Parsers/VcardParser.cs index 4b45eef..2b7414d 100644 --- a/VisualCard/Parsers/VcardParser.cs +++ b/VisualCard/Parsers/VcardParser.cs @@ -68,7 +68,7 @@ public Card Parse() // Iterate through all the lines bool constructing = false; StringBuilder valueBuilder = new(); - string[] allowedTypes = ["HOME", "WORK", "PREF", "X-OTHER"]; + string[] allowedTypes = ["HOME", "WORK", "PREF"]; for (int i = 0; i < CardContent.Length; i++) { // Get line @@ -166,7 +166,7 @@ public Card Parse() foreach (string elementType in elementTypes) { string elementTypeUpper = elementType.ToUpper(); - if (!allowedTypes.Contains(elementTypeUpper) && !extraAllowedTypes.Contains(elementTypeUpper)) + if (!allowedTypes.Contains(elementTypeUpper) && !extraAllowedTypes.Contains(elementTypeUpper) && !elementTypeUpper.StartsWith("X-")) throw new InvalidDataException($"Part info type {classType.Name} doesn't support property type {elementTypeUpper} because the following base types are supported: [{string.Join(", ", allowedTypes)}] and the extra types are supported: [{string.Join(", ", extraAllowedTypes)}]"); }