From 4e791ef722f39ca3aae0a8c8b7028aded76e59c8 Mon Sep 17 00:00:00 2001 From: andrewshuba Date: Tue, 22 Oct 2019 10:32:29 +0300 Subject: [PATCH] - fix not English letters in forms --- includes/core/um-actions-form.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index 63f5c868..49aab0d0 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -732,10 +732,12 @@ function um_submit_form_errors_hook_( $args ) { if ( $args[ $key ] != '' ) { - if( ! ctype_alpha( str_replace(' ', '', $args[$key] ) ) ){ - UM()->form()->add_error( $key , __('You must provide alphabetic letters','ultimate-member') ); + if ( ! preg_match( '/^\p{L}+$/u', str_replace( ' ', '', $args[ $key ] ) ) ) { + UM()->form()->add_error( $key, __( 'You must provide alphabetic letters', 'ultimate-member' ) ); } + } + break; case 'lowercase':