Changeset 20090 for extensions/UserCollections/include/functions.inc.php
- Timestamp:
- Jan 12, 2013, 3:13:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/functions.inc.php
r16688 r20090 32 32 } 33 33 34 function uc_check_email_validity($mail_address) 35 { 36 if (function_exists('email_check_format')) 37 { 38 return email_check_format($mail_address); // Piwigo 2.5 39 } 40 else if (version_compare(PHP_VERSION, '5.2.0') >= 0) 41 { 42 return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false; 43 } 44 else 45 { 46 $atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; // before arobase 47 $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 48 $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 49 50 return (bool)preg_match($regex, $mail_address); 51 } 52 } 53 34 54 ?>
Note: See TracChangeset
for help on using the changeset viewer.