Special Characters In Name

JynX

Posting Freak
Feb 6, 2016
710
438
Hello there,

I've recently encountered an issue that I never realized was an issue until now. I'm looking for a fix to remove the ability to use special characters such as lightning bolts, stars, skulls, and any other special characters in people's username. I've searched both here and the rival forums as well as Google itself, so if you could help I'd greatly appreciate it.

e960b6066ecc422bb63b6dfaeae9a77f.png
 

Joe

Well-Known Member
Jun 10, 2012
4,090
1,918
Code:
final public function validName($username) 
{
    if(strlen($username) <= 25 && preg_match("/^[a-zA-Z0-9]+$/", $username))
    {         
        return true;     
    }             

    return false;
}
 

Users who are viewing this thread

Top