| @@ 1092-1100 (lines=9) @@ | ||
| 1089 | * @param string |
|
| 1090 | * @return bool |
|
| 1091 | */ |
|
| 1092 | public function valid_email($email) |
|
| 1093 | { |
|
| 1094 | if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@')) |
|
| 1095 | { |
|
| 1096 | $email = substr($email, 0, ++$atpos).idn_to_ascii(substr($email, $atpos)); |
|
| 1097 | } |
|
| 1098 | ||
| 1099 | return (bool) filter_var($email, FILTER_VALIDATE_EMAIL); |
|
| 1100 | } |
|
| 1101 | ||
| 1102 | // -------------------------------------------------------------------- |
|
| 1103 | ||
| @@ 1239-1247 (lines=9) @@ | ||
| 1236 | * @param string |
|
| 1237 | * @return bool |
|
| 1238 | */ |
|
| 1239 | public function valid_email($str) |
|
| 1240 | { |
|
| 1241 | if (function_exists('idn_to_ascii') && $atpos = strpos($str, '@')) |
|
| 1242 | { |
|
| 1243 | $str = substr($str, 0, ++$atpos).idn_to_ascii(substr($str, $atpos)); |
|
| 1244 | } |
|
| 1245 | ||
| 1246 | return (bool) filter_var($str, FILTER_VALIDATE_EMAIL); |
|
| 1247 | } |
|
| 1248 | ||
| 1249 | // -------------------------------------------------------------------- |
|
| 1250 | ||