Skip to content

Commit

Permalink
fix: only disallows '}' in format strings, use byte comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Insomniak47 authored and nblumhardt committed May 27, 2024
1 parent 920b8c8 commit 9d3a088
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Serilog/Parsing/MessageTemplateParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,7 @@ static bool TryGetDestructuringHint(char c, out Destructuring destructuring)
}
}

static bool IsValidInFormat(char c)
{
// This is the entire ascii printable range minus '}' and DEL
return (byte)c >= 32 && (byte)c < 127 && c != '}';
}
static bool IsValidInFormat(char c) => c != (byte)'}';

static TextToken ParseTextToken(int startAt, string messageTemplate, out int next)
{
Expand Down

0 comments on commit 9d3a088

Please sign in to comment.