From 66f62d5aa114a32893c53a679474cb817d508a89 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Sat, 16 Apr 2016 21:14:29 +0800 Subject: [PATCH] Fix username validation --- core/um-actions-account.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/um-actions-account.php b/core/um-actions-account.php index 429dc90b..78341a4e 100644 --- a/core/um-actions-account.php +++ b/core/um-actions-account.php @@ -132,6 +132,11 @@ } } + if ( ! empty( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) { + $ultimatemember->form->add_error('user_login', __('Your username is invalid','ultimatemember') ); + return; + } + // delete account if ( isset($_POST['um_account_submit']) && $_POST['um_account_submit'] == __('Delete Account','ultimatemember') ) { if ( strlen(trim( $_POST['single_user_password'] ) ) == 0 ) {