From 5ddbdc8a3c8e6fd0ce8c2852d9d1b8de56cae0e9 Mon Sep 17 00:00:00 2001 From: jonfalcon Date: Sun, 31 Jan 2016 09:39:02 -0800 Subject: [PATCH] Fix validation for change password --- core/um-actions-account.php | 4 ++-- core/um-actions-global.php | 31 ++++++++++++++++--------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/core/um-actions-account.php b/core/um-actions-account.php index ec7a97d2..429dc90b 100644 --- a/core/um-actions-account.php +++ b/core/um-actions-account.php @@ -101,8 +101,8 @@ $ultimatemember->account->current_tab = 'general'; // change password - if ( $_POST['current_user_password'] != '' ) { - if ( !wp_check_password( $_POST['current_user_password'], um_user('user_pass'), um_user('ID') ) ) { + if ( $_POST['current_user_password'] != '' || $_POST['user_password'] != '' || $_POST['confirm_user_password'] != '') { + if ( $_POST['current_user_password'] == '' || !wp_check_password( $_POST['current_user_password'], um_user('user_pass'), um_user('ID') ) ) { $ultimatemember->form->add_error('current_user_password', __('This is not your password','ultimatemember') ); $ultimatemember->account->current_tab = 'password'; } else { // correct password diff --git a/core/um-actions-global.php b/core/um-actions-global.php index a587e9bd..33590af9 100644 --- a/core/um-actions-global.php +++ b/core/um-actions-global.php @@ -1,55 +1,56 @@ - + '; - + ?> - +

- + - + - + - + - +