mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-04 02:55:50 +03:00
Merge pull request #58 from WPMGPRoSToTeMa/unicodefixes
Strip unprintable unicode characters from players' names
This commit is contained in:
commit
242e077476
@ -2098,7 +2098,12 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
|
|||||||
*pChar = ' ';
|
*pChar = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
Q_strcpy(name, newname);
|
||||||
|
Q_StripUnprintableAndSpace(name);
|
||||||
|
#else // REHLDS_FIXES
|
||||||
TrimSpace(newname, name);
|
TrimSpace(newname, name);
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
if (!Q_UnicodeValidate(name))
|
if (!Q_UnicodeValidate(name))
|
||||||
{
|
{
|
||||||
@ -4807,7 +4812,12 @@ void SV_ExtractFromUserinfo(client_t *cl)
|
|||||||
*p = ' ';
|
*p = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
Q_strcpy(newname, rawname);
|
||||||
|
Q_StripUnprintableAndSpace(newname);
|
||||||
|
#else // REHLDS_FIXES
|
||||||
TrimSpace(rawname, newname);
|
TrimSpace(rawname, newname);
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
if (!Q_UnicodeValidate(newname))
|
if (!Q_UnicodeValidate(newname))
|
||||||
{
|
{
|
||||||
|
@ -116,6 +116,11 @@ decodeFinishedMaybeCESU8:
|
|||||||
|
|
||||||
int __cdecl Q_IsUnprintableW(uchar16 c)
|
int __cdecl Q_IsUnprintableW(uchar16 c)
|
||||||
{
|
{
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
if (!iswprint(c))
|
||||||
|
return 1;
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 0x202A:
|
case 0x202A:
|
||||||
|
Loading…
Reference in New Issue
Block a user