From db2bc4a8556560ac0b7d305a3648ac673eeb0dec Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Thu, 9 Jul 2020 15:00:01 +0300 Subject: [PATCH] - fixed using HTML in textarea validation; --- includes/core/um-actions-form.php | 6 ++---- includes/core/um-filters-fields.php | 2 +- templates/password-change.php | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index 555b636b..4cbc81ab 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -523,10 +523,8 @@ function um_submit_form_errors_hook_( $args ) { } } - $profile_show_html_bio = UM()->options()->get( 'profile_show_html_bio' ); - - if ( $profile_show_html_bio == 1 && $key !== 'description' ) { - if ( isset( $array['html'] ) && $array['html'] == 0 ) { + if ( isset( $array['type'] ) && $array['type'] == 'textarea' && UM()->profile()->get_show_bio_key( $args ) !== $key ) { + if ( ! isset( $array['html'] ) || $array['html'] == 0 ) { if ( wp_strip_all_tags( $args[ $key ] ) != trim( $args[ $key ] ) ) { UM()->form()->add_error( $key, __( 'You can not use HTML tags here', 'ultimate-member' ) ); } diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php index d51d3768..eb09e2aa 100644 --- a/includes/core/um-filters-fields.php +++ b/includes/core/um-filters-fields.php @@ -692,7 +692,7 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) { $value = esc_url( $value ); } elseif ( 'textarea' == $type ) { if ( empty( $data['html'] ) ) { - $value = wp_kses_post( $value ); + $value = wp_kses_post( $value ); } } elseif ( 'rating' == $type ) { if ( ! is_numeric( $value ) ) { diff --git a/templates/password-change.php b/templates/password-change.php index 7808f93c..7b9101e2 100644 --- a/templates/password-change.php +++ b/templates/password-change.php @@ -3,11 +3,11 @@
- +
- +