|
From: Benjamin C. <bc...@us...> - 2002-04-01 15:42:44
|
Update of /cvsroot/phpbt/phpbt In directory usw-pr-cvs1:/tmp/cvs-serv16912 Modified Files: install.php newaccount.php Log Message: Changed the name of the valid_email function to reduce conflicts and changed the validation regex to allow longer TLDs Index: install.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/install.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- install.php 26 Mar 2002 17:30:20 -0000 1.17 +++ install.php 1 Apr 2002 15:42:40 -0000 1.18 @@ -93,8 +93,8 @@ /// /// Check the validity of an email address /// (From zend.com user russIndr) -function valid_email($email) { - return eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$', $email); +function bt_valid_email($email) { + return eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$', $email); } function grab_config_file() { @@ -151,7 +151,7 @@ $error = 'Please enter the phpBT email address'; } elseif (!$_pv['admin_login'] = trim($_pv['admin_login'])) { $error = 'Please enter the admin login'; - } elseif (!valid_email($_pv['admin_login'])) { + } elseif (!bt_valid_email($_pv['admin_login'])) { $error = 'Please use a valid email address for the admin login'; } elseif (!$_pv['admin_pass'] = trim($_pv['admin_pass'])) { $error = 'Please enter the admin password'; Index: newaccount.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/newaccount.php,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- newaccount.php 30 Mar 2002 20:06:27 -0000 1.27 +++ newaccount.php 1 Apr 2002 15:42:40 -0000 1.28 @@ -35,7 +35,7 @@ if (!EMAIL_IS_LOGIN && !$_pv['login'] = trim($_pv['login'])) $error = $STRING['givelogin']; - elseif (!$_pv['email'] or !valid_email($_pv['email'])) + elseif (!$_pv['email'] or !bt_valid_email($_pv['email'])) $error = $STRING['giveemail']; elseif ($db->getOne("select user_id from ".TBL_AUTH_USER. " where email = '{$_pv['email']}' ". |