Enforcing password complexity

Well, ended up fixing this after hours of banging my head against ones keyboard. Fixed by making the first parameter of my hooked function a value instead of a reference – curious when nearly all hooks in wordpress pass the error object by reference!

function validatePasswordReset( &$errors, $userData ) {
    return validateComplexPassword( $errors );
}

changed to

function validatePasswordReset( $errors, $userData ) {
    return validateComplexPassword( $errors );
}

Curious as to why most actions have a reference on the codex, for example:

http://codex.wordpress.org/Plugin_API/Action_Reference/user_profile_update_errors

but there is no entry for validate_password_reset?

Leave a Comment