View Single Post
  #4  
Old 11-30-2009, 03:42 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default Re: Allow @ and other characters as username

Open the include/register.php file and change this:

PHP Code:
if ((strcmp($uname_tmp$uname) != 0) || (!preg_match("/^[a-z0-9_-]+$/s"$uname) && $uname != "")) 

to this:

PHP Code:
if ((strcmp($uname_tmp$uname) != 0) || (!preg_match('/^[a-z0-9_@.-]+$/i'$uname) && $uname != "")) 

The default X-Cart 4.1 code allows only lowercase a-z, 0-9, -, and _. Oddly this code also has a flag to treat . as a line break, but there isn't a . in the code regex??

The new code will allow lower or uppercase a-z, 0-9, -, @, ., and _.
Reply With Quote