| @@ -18,9 +18,9 @@ | ||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $show_messages = apply_filters( 'frm_message_list', $show_messages ); |
| 21 | 21 | |
| 22 | -if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) { | |
| 22 | +if ( is_array( $show_messages ) && $show_messages !== array() ) { | |
| 23 | 23 | // Define a callback function to add 'data-action' attribute to allowed HTML tags |
| 24 | 24 | $add_data_action_callback = function ( $allowed_html ) { |
| 25 | 25 | $allowed_html['span']['data-action'] = true; |
| 26 | 26 | return $allowed_html; |
| @@ -32,9 +32,11 @@ | ||
| 32 | 32 | // Add the callback function to the 'frm_striphtml_allowed_tags' filter |
| 33 | 33 | add_filter( 'frm_striphtml_allowed_tags', $add_data_action_callback ); |
| 34 | 34 | |
| 35 | 35 | foreach ( $show_messages as $m ) { |
| 36 | - echo '<li>' . FrmAppHelper::kses( $m, array( 'a', 'br', 'span', 'p', 'svg', 'use' ) ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 36 | + echo '<li>'; | |
| 37 | + FrmAppHelper::kses_echo( $m, array( 'a', 'br', 'span', 'p', 'svg', 'use' ) ); | |
| 38 | + echo '</li>'; | |
| 37 | 39 | } |
| 38 | 40 | // Remove the callback function from the 'frm_striphtml_allowed_tags' filter |
| 39 | 41 | remove_filter( 'frm_striphtml_allowed_tags', $add_data_action_callback ); |
| 40 | 42 | ?> |
| @@ -45,13 +47,15 @@ | ||
| 45 | 47 | |
| 46 | 48 | if ( ! empty( $warnings ) && is_array( $warnings ) ) { |
| 47 | 49 | ?> |
| 48 | 50 | <div class="frm_warning_style inline" role="alert"> |
| 49 | - <div class="frm_warning_heading"> <?php echo esc_html__( 'Warning:', 'formidable' ); ?></div> | |
| 51 | + <div class="frm_warning_heading"> <?php esc_html_e( 'Warning:', 'formidable' ); ?></div> | |
| 50 | 52 | <ul id="frm_warnings"> |
| 51 | 53 | <?php |
| 52 | 54 | foreach ( $warnings as $warning ) { |
| 53 | - echo '<li>' . FrmAppHelper::kses( $warning, array( 'a', 'br' ) ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 55 | + echo '<li>'; | |
| 56 | + FrmAppHelper::kses_echo( $warning, array( 'a', 'br' ) ); | |
| 57 | + echo '</li>'; | |
| 54 | 58 | } |
| 55 | 59 | ?> |
| 56 | 60 | </ul> |
| 57 | 61 | </div> |
| @@ -63,9 +67,11 @@ | ||
| 63 | 67 | <div class="frm_error_style inline" role="alert"> |
| 64 | 68 | <ul id="frm_errors"> |
| 65 | 69 | <?php |
| 66 | 70 | foreach ( $errors as $error ) { |
| 67 | - echo '<li>' . FrmAppHelper::kses( $error, array( 'a', 'br' ) ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 71 | + echo '<li>'; | |
| 72 | + FrmAppHelper::kses_echo( $error, array( 'a', 'br' ) ); | |
| 73 | + echo '</li>'; | |
| 68 | 74 | } |
| 69 | 75 | ?> |
| 70 | 76 | </ul> |
| 71 | 77 | </div> |