CelesteNet
CelesteNet copied to clipboard
Use `Ordinal` instead of `InvariantCulture` comparison
Invariant culture string comparisons normalize the string, which we don't want. Always use ordinal string comparisons instead; see this article.
Using invariant culture crashes the game when typing /tp tm
when a player with the username ™
is connected to the server, as "™".StartsWith("tm", StringComparison.InvariantCultureIgnoreCase)
returns true
and causes the length on line 1114
to be out of bounds.
https://github.com/0x0ade/CelesteNet/blob/27ac4d76f52f8bbade6e386a6891977f4c059e40/CelesteNet.Client/Components/CelesteNetChatComponent.cs#L1113-L1118