mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 22:23:37 +09:00
- fixed password length validation;
- added settings for the password min/max length;
This commit is contained in:
@@ -543,11 +543,16 @@ if ( ! class_exists( 'um\core\Password' ) ) {
|
||||
|
||||
if ( UM()->options()->get( 'reset_require_strongpass' ) ) {
|
||||
|
||||
if ( strlen( utf8_decode( $args['user_password'] ) ) < 8 ) {
|
||||
$min_length = UM()->options()->get( 'password_min_chars' );
|
||||
$min_length = ! empty( $min_length ) ? $min_length : 8;
|
||||
$max_length = UM()->options()->get( 'password_max_chars' );
|
||||
$max_length = ! empty( $max_length ) ? $max_length : 30;
|
||||
|
||||
if ( mb_strlen( $args['user_password'] ) < $min_length ) {
|
||||
UM()->form()->add_error( 'user_password', __( 'Your password must contain at least 8 characters', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
if ( strlen( utf8_decode( $args['user_password'] ) ) > 30 ) {
|
||||
if ( mb_strlen( $args['user_password'] ) > $max_length ) {
|
||||
UM()->form()->add_error( 'user_password', __( 'Your password must contain less than 30 characters', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user