Skip to content

Commit

Permalink
add - Allowed all X-nonstandard types
Browse files Browse the repository at this point in the history
---

We've allowed all X-nonstandard types.

---

Type: add
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Apr 4, 2024
1 parent 5e37306 commit d4ee171
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions VisualCard/Parsers/VcardParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)}]");
}

Expand Down

0 comments on commit d4ee171

Please sign in to comment.