From 0ae17ff00f6c6cfffc8eca06baea8dc608849cc3 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Wed, 12 Jul 2023 10:10:09 +0300 Subject: [PATCH] - wp_kses for field error --- includes/core/class-fields.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 31d473fb..4a5be146 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -508,26 +508,25 @@ if ( ! class_exists( 'um\core\Fields' ) ) { * * @return string */ - function field_error( $text, $force_show = false ) { + public function field_error( $text, $force_show = false ) { if ( empty( $text ) ) { return ''; } if ( $force_show ) { - $output = '
' . esc_attr( $text ) . '
'; + $output = '
' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '
'; return $output; } - - if ( isset( $this->set_id ) && UM()->form()->processing == $this->set_id ) { - $output = '
' . esc_attr( $text ) . '
'; + if ( isset( $this->set_id ) && UM()->form()->processing === $this->set_id ) { + $output = '
' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '
'; } else { $output = ''; } if ( ! UM()->form()->processing ) { - $output = '
' . esc_attr( $text ) . '
'; + $output = '
' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '
'; } return $output; @@ -542,26 +541,25 @@ if ( ! class_exists( 'um\core\Fields' ) ) { * * @return string */ - function field_notice( $text, $force_show = false ) { + public function field_notice( $text, $force_show = false ) { if ( empty( $text ) ) { return ''; } if ( $force_show ) { - $output = '
' . esc_attr( $text ) . '
'; + $output = '
' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '
'; return $output; } - - if ( isset( $this->set_id ) && UM()->form()->processing == $this->set_id ) { - $output = '
' . esc_attr( $text ) . '
'; + if ( isset( $this->set_id ) && UM()->form()->processing === $this->set_id ) { + $output = '
' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '
'; } else { $output = ''; } if ( ! UM()->form()->processing ) { - $output = '
' . esc_attr( $text ) . '
'; + $output = '
' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '
'; } return $output;