Welcome Guest, Not a member yet? Register   Sign In
Error with email class in CI 3.1.8
#21

(04-07-2018, 05:34 AM)InsiteFX Wrote: ./system/libraries/Form_validation.php
PHP Code:
    /**
     * Valid Email
     *
     * @param    string
     * @return    bool
     */
    
public function valid_email($str)
    {
        if (
function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#'$str$matches))
        {
            
$domain defined('INTL_IDNA_VARIANT_UTS46')
                ? 
idn_to_ascii($matches[2], 0INTL_IDNA_VARIANT_UTS46)
                : 
idn_to_ascii($matches[2]);
            
$str $matches[1].'@'.$domain;
        }

        return (bool) 
filter_var($strFILTER_VALIDATE_EMAIL);
    } 

Now you can see that it is checking the email domain.

im using the same validation rule in another CI 3.1.5 and it works perfect. but i have this issue on my new project with CI 3.1.8 !

the domain of the entered email is @gmail.com and i tested with my @icloud.com email. but keep showing error that i must enter valid email address !

i have google it and some people reported this as a bug. is it a bug?
Reply
#22

I'll try it later today on my internet providers smtp host comcast.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#23

I just checked the CodeIgniter 3.1.5 version of the Form_validation class and it doe's not
check for the email domain like CodeIgniter 3.1.8 doe's.

So maybe that is what is causing your problem.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#24

(04-07-2018, 08:38 AM)ardavan Wrote:
(04-07-2018, 05:34 AM)InsiteFX Wrote: ./system/libraries/Form_validation.php
PHP Code:
/**
 * Valid Email
 *
 * @param string
 * @return bool
 */
 
public function valid_email($str)
 {
 if (
function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#'$str$matches))
 {
 
$domain defined('INTL_IDNA_VARIANT_UTS46')
 ? 
idn_to_ascii($matches[2], 0INTL_IDNA_VARIANT_UTS46)
 : 
idn_to_ascii($matches[2]);
 
$str $matches[1].'@'.$domain;
 }

 return (bool) 
filter_var($strFILTER_VALIDATE_EMAIL);
 } 

Now you can see that it is checking the email domain.

im using the same validation rule in another CI 3.1.5 and it works perfect. but i have this issue on my new project with CI 3.1.8 !

the domain of the entered email is @gmail.com and i tested with my @icloud.com email. but keep showing error that i must enter valid email address !

i have google it and some people reported this as a bug. is it a bug?

The form validation work. The error is in the code. Without the code, i can not help.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB