Changeset 13189 for trunk/src/bp-members/screens/register.php
- Timestamp:
- 12/16/2021 06:16:38 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/screens/register.php
r13170 r13189 16 16 $bp = buddypress(); 17 17 18 if ( ! bp_is_current_component( 'register' ) || bp_current_action() ) 18 if ( ! bp_is_current_component( 'register' ) || bp_current_action() ) { 19 19 return; 20 } 20 21 21 22 // Not a directory. … … 88 89 } 89 90 90 $signup_pass = ''; 91 if ( isset( $_POST['signup_password'] ) ) { 92 $signup_pass = wp_unslash( $_POST['signup_password'] ); 93 } 94 95 $signup_pass_confirm = ''; 96 if ( isset( $_POST['signup_password_confirm'] ) ) { 97 $signup_pass_confirm = wp_unslash( $_POST['signup_password_confirm'] ); 98 } 99 100 // Check the account password for problems. 101 $account_password = bp_members_validate_user_password( $signup_pass, $signup_pass_confirm ); 102 $password_error = $account_password->get_error_message(); 91 // Password strength check. 92 $required_password_strength = bp_members_user_pass_required_strength(); 93 $current_password_strength = null; 94 if ( isset( $_POST['_password_strength_score'] ) ) { 95 $current_password_strength = (int) $_POST['_password_strength_score']; 96 } 97 98 if ( $required_password_strength && ! is_null( $current_password_strength ) && $required_password_strength > $current_password_strength ) { 99 $account_password = new WP_Error( 100 'not_strong_enough_password', 101 __( 'Your password is not strong enougth to be allowed on this site. Please use a stronger password.', 'buddypress' ) 102 ); 103 } else { 104 $signup_pass = ''; 105 if ( isset( $_POST['signup_password'] ) ) { 106 $signup_pass = wp_unslash( $_POST['signup_password'] ); 107 } 108 109 $signup_pass_confirm = ''; 110 if ( isset( $_POST['signup_password_confirm'] ) ) { 111 $signup_pass_confirm = wp_unslash( $_POST['signup_password_confirm'] ); 112 } 113 114 // Check the account password for problems. 115 $account_password = bp_members_validate_user_password( $signup_pass, $signup_pass_confirm ); 116 } 117 118 $password_error = $account_password->get_error_message(); 103 119 104 120 if ( $password_error ) {
Note: See TracChangeset
for help on using the changeset viewer.