mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Added iswprint check in Q_IsUnprintableW function
Added Q_StripUnprintableAndSpace function using for player name
This commit is contained in:
parent
cb74311375
commit
7db9030b6f
@ -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))
|
||||
{
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user