Custom Registration throwing "invalid email" error for mobile devices only…

This topic has 18 replies, 2 voices, and was last updated 9 years, 10 months ago ago by Eva Kemp

  • Avatar: shibumik
    shibumik
    Participant
    February 24, 2015 at 17:04

    I noticed the custom registration page throws an “invalid email” error on ipad and iphone devices when registering, but not so from the PC. I went out to your site and tested it there on your mock registration page with the same results. Can you please advise on this matter?

    Thanks so much!

    17 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    February 24, 2015 at 18:05

    Hello,

    What theme version are you using? Our demo site has old version, but I’ve just tested registration on the site with the latest theme version and haven’t got any errors.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: shibumik
    shibumik
    Participant
    February 25, 2015 at 20:22

    Hi Eva,

    Wee are using version 2.5. Sorry for the late response.

    Kevin

    Avatar: Eva
    Eva Kemp
    Support staff
    February 25, 2015 at 20:56

    Hello,

    Please update the theme to the latest version 2.6.1
    Don’t forget to create a back up before update!

    https://www.youtube.com/watch?v=KdWESIIPU1k

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 00:28

    Updated to 2.6.1. No Change. When registering on an iPad or iPhone it errors out saying that the email address is invalid. This is happening on several other web sites that use Legenda as well. It does fine on a desktop.

    Thanks,
    Kevin

    Avatar: Eva
    Eva Kemp
    Support staff
    February 26, 2015 at 00:56

    Hello,

    As you’re using old Woocommerce plugin version you need update it as well because old plugins versions may create some conflicts to the latest theme version.
    Also please make sure all the required plugins are up to date. You can download the latest plugins versions here:
    https://www.8theme.com/download-plugins/

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 01:35

    Nope. Already skinned that cat. We have another site using the latest tragic Woocommerce update and customers still cannot register using an iPad or iPhone. There is something that’s eval’ing the email address incorrectly, perhaps too strictly, for some reason and throwing the email address back as invalid.

    I am wondering if this is a Legenda issue, or a Woo Commerce issue or a WordPress issue. It is happening on the custom registration screen. What is that screen calling to?

    Thanks,
    Kevin

    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 03:00

    Hi Eva,

    We’ve tested the site using Android, Windows and Linux devices and all work well. The custom registration fails only on iOS devices. We checked out a few other sites using Legenda and found the same issue. Is there any way we can remove the email checking to see if it corrects the iOS issue?

    We’ve also noticed compatibility issues with iThemes Security. In short, it can stop the registration page from appearing in some cases. Don’t know why.

    Thanks,
    Kevin

    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 03:33

    Last one for tonight.

    I modified the theme functions file to return the email address with the error. I wanted to see if any special characters or additional spaces might be added to the string. None were. The email address was returned in pristine condition.

    The actual string: PLEASE ENTER A VALID EMAIL.’CLIENT.CARE@********.COM’

    So, the string is being passed accurately. I wonder what is tripping up the program at this point. It doesn’t make sense.

    My program mods to return the above string….

    /*Start
    if(!preg_match(“/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/”, $email)) {
    $return[‘status’] = ‘error’;
    $return[‘msg’] = __( “Please enter a valid email.”.”‘”.$email.”‘”, ETHEME_DOMAIN );
    echo json_encode($return);
    die();
    END */

    Avatar: Eva
    Eva Kemp
    Support staff
    February 26, 2015 at 11:29

    Hello,

    Please provide us with FTP and wp-admin panel credentials in Private Content.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 13:41

    Here you go.

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Support staff
    February 26, 2015 at 14:50

    Hello,

    Sorry, but the credentials are incorrect.
    Please check them.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 15:35

    Hi Eva,

    See below…

    Please, contact administrator
    for this information.
    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 16:48

    Notes…

    Please, contact administrator
    for this information.
    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 22:49

    Okay, here’s what’s happening…

    With iOS, when you add an email address to the registration for it must be added in LOWER CASE or the registration fails. Periods in the address do not cause a failure. I am going to mod the code to change it to lower case and see how all goes.

    Kevin

    Please, contact administrator
    for this information.
    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 23:10

    The FIX:

    The problem is iOS users can fail on registration because iOS expects a LOWER-CASE email address for some reason. Legenda preserves the input case so iOS fails it if there are any upper case characters present. We simply need to transform the email address to lower case and all is well for iOS.

    This problem can be corrected easily. I am using Legenda 2.5. This will be similar in later versions from what I see until it is corrected by 8Theme. The theme-function.php file is in the /wp-content/themes/legenda/framework directory. It is where we need to play. In my file, it was line 1209 where I started. To change the email address to lower case, simply add the code I added below. (I know could have applied it to the original $email code line, but I like to keep my edits clean.)

    Hope this helps for anyone who is experiencing this iOS issue. Hopefully 8Theme will incorporate it into their next update.

    Kevin

    
    ~LINE 1201       //We shall SQL escape all inputs
    	        $username = esc_sql($_REQUEST['username']);
    	        if(empty($username)) {
    				$return['status'] = 'error';
    				$return['msg'] = __( "User name should not be empty.", ETHEME_DOMAIN );
    				echo json_encode($return);
    	            die();
    	        }
    	        $email = esc_sql($_REQUEST['email']);
    
    /************************** Change email to lower case for iOS  BY KW ********************/
    /************************** Add the next line here... ************************************/
    			$email = strtolower($email);
    /************************** End lower case email mod by KW *******************************/ 
    			
    	        if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/", $email)) {
    				$return['status'] = 'error';
    				$return['msg'] = __( "Please enter a valid email.", ETHEME_DOMAIN );
    				echo json_encode($return);
    	            die();
    	        }
    
    Please, contact administrator
    for this information.
    Avatar: shibumik
    shibumik
    Participant
    February 26, 2015 at 23:17

    Ooops!

    It’s the theme-functions.php file we’re talking about. (Forgot the ‘s’!)

    Avatar: Eva
    Eva Kemp
    Support staff
    February 26, 2015 at 23:49

    Hello,

    We’re glad you’ve found the solution.
    That’s great.

    If there are any questions feel free to contact us.
    Regards,
    Eva Kemp.

  • Viewing 18 results - 1 through 18 (of 18 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.