Fix reset password validation

This commit is contained in:
champsupertramp
2016-08-21 16:05:29 +08:00
parent 129615dc7b
commit f9cd456c5f
+8 -3
View File
@@ -98,13 +98,18 @@
if ( $live_timestamp - $form_timestamp < 3 && um_get_option('enable_timebot') == 1 )
wp_die( __('Whoa, slow down! You\'re seeing this message because you tried to submit a form too fast and we think you might be a spam bot. If you are a real human being please wait a few seconds before submitting the form. Thanks!') );
$user = "";
if ( empty( trim( $_POST['username_b'] ) ) ) {
foreach ( $_POST as $key => $val ) {
if( strstr( $key, "username_b") ){
$user = $val;
}
}
if ( empty( trim( $user ) ) ) {
$ultimatemember->form->add_error('username_b', __('Please provide your username or email','ultimatemember') );
}
$user = $_POST['username_b'];
if ( ( !is_email( $user ) && !username_exists( $user ) ) || ( is_email( $user ) && !email_exists( $user ) ) ) {
$ultimatemember->form->add_error('username_b', __('We can\'t find an account registered with that address or username','ultimatemember') );
} else {