Detecting illegal name characters in a string?
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
In the IRC command, check if the new name is valid:
PHP код:
IsValidName(const p_name[])
{
    for (new 
istrlen(p_name); != ji++)
    {
        switch (
p_name[i])
        {
            case  
'0' .. '9''A' .. 'Z''a' .. 'z''['']''('')''$''@''.''_''=': continue;
            default: return 
0;
        }
    }
    return 
1;

Oh my, that just worked perfectly. I've been trying to find something like this from past few hours. Thanks a lot!

Quote:
Originally Posted by Meller
Посмотреть сообщение
Okay, This is just a tip:
Don't make blacklists, Make whitelists.
So much better and shorter.
Ehm, what?
Reply


Messages In This Thread
Detecting illegal name characters in a string? - by Sjn - 16.05.2016, 18:03
Re: Detecting illegal name characters in a string? - by Luicy. - 16.05.2016, 18:08
Re: Detecting illegal name characters in a string? - by Konstantinos - 16.05.2016, 18:12
Re: Detecting illegal name characters in a string? - by Sjn - 16.05.2016, 18:18
Re: Detecting illegal name characters in a string? - by BornHuman - 16.05.2016, 21:31

Forum Jump:


Users browsing this thread: 1 Guest(s)