WordPress.org

Ready to get started?Download WordPress

Forums

CM Invitation Codes
[BUG] Ignores whether there are errors when regisering (1 post)

  1. edlongman
    Member
    Posted 11 months ago #

    When a user is registering if they do not enter a valid email, username etc. and when there is a redirect_to value set in the url.
    The registration page does not show the errors and the user is redirected to the page in the redirect_to alue.
    This is because this code is wrong in CMInvitationCodesActivation.php:

    if (!empty($_POST['redirect_to'])) {
                // if a redirect_to is set, honor it
                wp_safe_redirect($_POST['redirect_to']);
                exit();
            }
    
            // if there is an error already, let it do it's thing
            if ($errors->get_error_code())
                return $errors;

    it should be:

    // if there is an error already, let it do it's thing
            if ($errors->get_error_code())
                return $errors;
    
            if (!empty($_POST['redirect_to'])) {
                // if a redirect_to is set, honor it
                wp_safe_redirect($_POST['redirect_to']);
                exit();
            }

    Also - great plugin once I fixed this!

    http://wordpress.org/extend/plugins/cm-invitation-codes/

Reply

You must log in to post.

About this Plugin

About this Topic