[split] Bug in new form validation? |
-
k_m
Newbie
-
Posts: 1
Threads: 0
Joined: Mar 2018
Reputation:
0
(01-17-2018, 02:30 PM)what do you think about using of code v.3.1.6 in this case ? Wrote: /that same in email.php library/
public function valid_email($str)
{
if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches))
{
if (defined('INTL_IDNA_VARIANT_UTS46'))
{
$domain = is_php('5.4')
? idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46)
: idn_to_ascii($matches[2]);
$str = $matches[1].'@'.$domain;
} else {
$str = $matches[1].'@'.idn_to_ascii($matches[2]);
}
}
return (bool) filter_var($str, FILTER_VALIDATE_EMAIL);
}
|
Messages In This Thread |
RE: [split] Bug in new form validation? - by k_m - 03-18-2018, 05:38 AM
|