CodeIgniter Forums
Error with email class in CI 3.1.8 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Error with email class in CI 3.1.8 (/showthread.php?tid=70394)

Pages: 1 2 3


RE: Error with email class in CI 3.1.8 - ardavan - 04-07-2018

(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?


RE: Error with email class in CI 3.1.8 - InsiteFX - 04-08-2018

I'll try it later today on my internet providers smtp host comcast.


RE: Error with email class in CI 3.1.8 - InsiteFX - 04-08-2018

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.


RE: Error with email class in CI 3.1.8 - Paradinight - 04-08-2018

(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.