View Single Post
  #17  
Old 03-25-2005, 10:19 PM
 
x-light x-light is offline
 

Member
  
Join Date: Mar 2005
Posts: 29
 

Default minor update (forcing all emails to lowercase)

I forgot a minor detail where the code will allow duplicate email address thus cause an duplicate entry error in mysql since the email tests do not check for case sensitivity. The problem can be easily fixed by forcing all email address entries either at initial registration or profile updates to lowercase. Here is what you need to change.

file: include/register.php v1

find this section of code

Code:
# mod.use.email.rather.username # check if email already exist in customers table if( $email == func_query_first_cell("select email from $sql_tbl[customers] where email='$email'")) { # duplicate email not allowed $eerror = true; }

and replace with

Code:
# mod.use.email.rather.username # check if email already exist in customers table $email = strtolower($email); if( $email == func_query_first_cell("select email from $sql_tbl[customers] where email='$email'")) { # duplicate email not allowed $eerror = true; }

~x-light
__________________
X-Cart 4.xx Gold
Enterprise Linux
Reply With Quote