diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 826e3cf2..dd36975a 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -378,20 +378,23 @@ if ( ! class_exists( 'um\core\Fields' ) ) { * @return string */ function field_error( $text, $force_show = false ) { + + if( empty( $text ) ) return; + if ( $force_show ) { - $output = '
' . $text . '
'; + $output = '
' . esc_attr( $text ) . '
'; return $output; } if ( isset( $this->set_id ) && UM()->form()->processing == $this->set_id ) { - $output = '
' . $text . '
'; + $output = '
' . esc_attr( $text ) . '
'; } else { $output = ''; } if ( ! UM()->form()->processing ) { - $output = '
' . $text . '
'; + $output = '
' . esc_attr( $text ) . '
'; } return $output; @@ -407,20 +410,23 @@ if ( ! class_exists( 'um\core\Fields' ) ) { * @return string */ function field_notice( $text, $force_show = false ) { + + if( empty( $text ) ) return; + if ( $force_show ) { - $output = '
' . $text . '
'; + $output = '
' . esc_attr( $text ) . '
'; return $output; } if ( isset( $this->set_id ) && UM()->form()->processing == $this->set_id ) { - $output = '
' . $text . '
'; + $output = '
' . esc_attr( $text ) . '
'; } else { $output = ''; } if ( ! UM()->form()->processing ) { - $output = '
' . $text . '
'; + $output = '
' . esc_attr( $text ) . '
'; } return $output;