mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix biography field validation in profile header and forms
This commit is contained in:
@@ -210,10 +210,14 @@
|
||||
$ultimatemember->form->add_error($key, sprintf(__('Your %s must contain less than %s characters','ultimatemember'), $array['label'], $array['max_chars']) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $array['html'] ) && $array['html'] == 0 ) {
|
||||
if ( wp_strip_all_tags( $args[$key] ) != trim( $args[$key] ) ) {
|
||||
$ultimatemember->form->add_error($key, __('You can not use HTML tags here','ultimatemember') );
|
||||
|
||||
$profile_show_html_bio = um_get_option('profile_show_html_bio');
|
||||
|
||||
if( $profile_show_html_bio == 1 && $key !== "description" ){
|
||||
if ( isset( $array['html'] ) && $array['html'] == 0 ) {
|
||||
if ( wp_strip_all_tags( $args[$key] ) != trim( $args[$key] ) ) {
|
||||
$ultimatemember->form->add_error($key, __('You can not use HTML tags here','ultimatemember') );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,8 +444,8 @@
|
||||
|
||||
if ( isset( $args['description'] ) ) {
|
||||
$max_chars = um_get_option('profile_bio_maxchars');
|
||||
if ( strlen( utf8_decode( $args['description'] ) ) > $max_chars && $max_chars ) {
|
||||
$ultimatemember->form->add_error('description', sprintf(__('Your user description must contain less than %s characters','ultimatemember'), $max_chars ) );
|
||||
if ( strlen( utf8_decode( $args['description'] ) ) > $max_chars && $max_chars ) {
|
||||
$ultimatemember->form->add_error('description', sprintf(__('Your user description must contain less than %s characters','ultimatemember'), $max_chars ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user