- fixed using HTML in textarea validation;

This commit is contained in:
nikitasinelnikov
2020-07-09 15:00:01 +03:00
parent 3d8b9f7cf4
commit db2bc4a855
3 changed files with 5 additions and 7 deletions
+2 -4
View File
@@ -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' ) );
}
+1 -1
View File
@@ -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 ) ) {