Thread: Accounts
View Single Post
  #2  
Old 12-11-2012, 09:26 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 584,959
Hall of Famer is on a distinguished road
Default

It is not difficult to fix. I dont wish to touch the UserValidator class though since its way too messy and likely to be replaced in future. For now, just go to register.php file and find this line:

PHP Code:
elseif($mysidia->input->action() == "register"){
  
// First of all, lets examine if the user register session is set
  
$mysidia->session->validate("register"); 
add below:

PHP Code:
$pattern '#^[A-Z0-9 ]+$#i';
if(!
preg_match ($pattern$mysidia->input->post("username"))){
    throw new 
Exception("Error: Invalid Username Specified, it can only contain alphanumeric characters and blank space!");    

__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote