- 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 ) ) {
+2 -2
View File
@@ -3,11 +3,11 @@
<div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( $form_id ); ?>">
<div class="um-form">
<form method="post" action="">
<input type="hidden" name="_um_password_change" id="_um_password_change" value="1" />
<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( $args['user_id'] ); ?>" />
<input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>">
<input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
<?php
/**