Skip to content

Commit

Permalink
imp - Whitelisted BLOB encoding as blob
Browse files Browse the repository at this point in the history
---

We've added BLOB to the encoding check for key, logo, photo, and sound types.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Apr 4, 2024
1 parent e197096 commit f5f18bb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion VisualCard/Parts/Implementations/KeyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[
{
// vCard 3.0 handles this in a different way
keyEncoding = VcardParserTools.GetValuesString(finalArgs, "b", VcardConstants._encodingArgumentSpecifier);
if (!keyEncoding.Equals("b", StringComparison.OrdinalIgnoreCase))
if (!keyEncoding.Equals("b", StringComparison.OrdinalIgnoreCase) &&
!keyEncoding.Equals("BLOB", StringComparison.OrdinalIgnoreCase))
{
// Since we don't need embedded keys, we need to check a URL.
if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri))
Expand Down
4 changes: 3 additions & 1 deletion VisualCard/Parts/Implementations/LogoInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[
{
// vCard 3.0 handles this in a different way
logoEncoding = VcardParserTools.GetValuesString(finalArgs, "b", VcardConstants._encodingArgumentSpecifier);
if (!logoEncoding.Equals("b", StringComparison.OrdinalIgnoreCase) && !logoEncoding.Equals("BASE64", StringComparison.OrdinalIgnoreCase))
if (!logoEncoding.Equals("b", StringComparison.OrdinalIgnoreCase) &&
!logoEncoding.Equals("BASE64", StringComparison.OrdinalIgnoreCase) &&
!logoEncoding.Equals("BLOB", StringComparison.OrdinalIgnoreCase))
{
// Since we don't need embedded logos, we need to check a URL.
if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri))
Expand Down
4 changes: 3 additions & 1 deletion VisualCard/Parts/Implementations/PhotoInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[
{
// vCard 3.0 handles this in a different way
photoEncoding = VcardParserTools.GetValuesString(finalArgs, "b", VcardConstants._encodingArgumentSpecifier);
if (!photoEncoding.Equals("b", StringComparison.OrdinalIgnoreCase) && !photoEncoding.Equals("BASE64", StringComparison.OrdinalIgnoreCase))
if (!photoEncoding.Equals("b", StringComparison.OrdinalIgnoreCase) &&
!photoEncoding.Equals("BASE64", StringComparison.OrdinalIgnoreCase) &&
!photoEncoding.Equals("BLOB", StringComparison.OrdinalIgnoreCase))
{
// Since we don't need embedded photos, we need to check a URL.
if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri))
Expand Down
4 changes: 3 additions & 1 deletion VisualCard/Parts/Implementations/SoundInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[
{
// vCard 3.0 handles this in a different way
soundEncoding = VcardParserTools.GetValuesString(finalArgs, "b", VcardConstants._encodingArgumentSpecifier);
if (!soundEncoding.Equals("b", StringComparison.OrdinalIgnoreCase) && !soundEncoding.Equals("BASE64", StringComparison.OrdinalIgnoreCase))
if (!soundEncoding.Equals("b", StringComparison.OrdinalIgnoreCase) &&
!soundEncoding.Equals("BASE64", StringComparison.OrdinalIgnoreCase) &&
!soundEncoding.Equals("BLOB", StringComparison.OrdinalIgnoreCase))
{
// Since we don't need embedded sounds, we need to check a URL.
if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri))
Expand Down

0 comments on commit f5f18bb

Please sign in to comment.