Quantcast
Channel: Topic Tag: error | WordPress.org
Viewing all articles
Browse latest Browse all 31584

edlongman on "[Plugin: CM Invitation Codes] [BUG] Ignores whether there are errors when regisering"

$
0
0

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/


Viewing all articles
Browse latest Browse all 31584

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>