2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-01 01:25:38 +03:00

Merge pull request #58 from WPMGPRoSToTeMa/unicodefixes

Strip unprintable unicode characters from players' names
This commit is contained in:
dreamstalker 2015-07-16 09:47:23 +04:00
commit 242e077476
2 changed files with 15 additions and 0 deletions

View File

@ -2098,7 +2098,12 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
*pChar = ' ';
}
#ifdef REHLDS_FIXES
Q_strcpy(name, newname);
Q_StripUnprintableAndSpace(name);
#else // REHLDS_FIXES
TrimSpace(newname, name);
#endif // REHLDS_FIXES
if (!Q_UnicodeValidate(name))
{
@ -4807,7 +4812,12 @@ void SV_ExtractFromUserinfo(client_t *cl)
*p = ' ';
}
#ifdef REHLDS_FIXES
Q_strcpy(newname, rawname);
Q_StripUnprintableAndSpace(newname);
#else // REHLDS_FIXES
TrimSpace(rawname, newname);
#endif // REHLDS_FIXES
if (!Q_UnicodeValidate(newname))
{

View File

@ -116,6 +116,11 @@ decodeFinishedMaybeCESU8:
int __cdecl Q_IsUnprintableW(uchar16 c)
{
#ifdef REHLDS_FIXES
if (!iswprint(c))
return 1;
#endif // REHLDS_FIXES
switch (c)
{
case 0x202A: