| @@ -17,24 +17,15 @@ | ||
| 17 | 17 | $show_messages = array(); |
| 18 | 18 | } |
| 19 | 19 | $show_messages = apply_filters( 'frm_message_list', $show_messages ); |
| 20 | 20 | if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) { |
| 21 | - // Define a callback function to add 'data-action' attribute to allowed HTML tags | |
| 22 | - $add_data_action_callback = function( $allowed_html ) { | |
| 23 | - $allowed_html['span']['data-action'] = true; | |
| 24 | - return $allowed_html; | |
| 25 | - }; | |
| 26 | 21 | ?> |
| 27 | 22 | <div class="frm_warning_style" role="alert"> |
| 28 | 23 | <ul id="frm_messages"> |
| 29 | 24 | <?php |
| 30 | - // Add the callback function to the 'frm_striphtml_allowed_tags' filter | |
| 31 | - add_filter( 'frm_striphtml_allowed_tags', $add_data_action_callback ); | |
| 32 | 25 | foreach ( $show_messages as $m ) { |
| 33 | - echo '<li>' . FrmAppHelper::kses( $m, array( 'a', 'br', 'span', 'p', 'svg', 'use' ) ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 26 | + echo '<li>' . FrmAppHelper::kses( $m, array( 'a', 'br', 'span', 'p' ) ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 34 | 27 | } |
| 35 | - // Remove the callback function from the 'frm_striphtml_allowed_tags' filter | |
| 36 | - remove_filter( 'frm_striphtml_allowed_tags', $add_data_action_callback ); | |
| 37 | 28 | ?> |
| 38 | 29 | </ul> |
| 39 | 30 | </div> |
| 40 | 31 | <?php |
| @@ -39,9 +30,9 @@ | ||
| 39 | 30 | </div> |
| 40 | 31 | <?php |
| 41 | 32 | } |
| 42 | 33 | |
| 43 | -if ( ! empty( $warnings ) && is_array( $warnings ) ) { | |
| 34 | +if ( isset( $warnings ) && is_array( $warnings ) && count( $warnings ) > 0 ) { | |
| 44 | 35 | ?> |
| 45 | 36 | <div class="frm_warning_style inline" role="alert"> |
| 46 | 37 | <div class="frm_warning_heading"> <?php echo esc_html__( 'Warning:', 'formidable' ); ?></div> |
| 47 | 38 | <ul id="frm_warnings"> |
| @@ -54,9 +45,9 @@ | ||
| 54 | 45 | </div> |
| 55 | 46 | <?php |
| 56 | 47 | } |
| 57 | 48 | |
| 58 | -if ( ! empty( $errors ) && is_array( $errors ) ) { | |
| 49 | +if ( isset( $errors ) && is_array( $errors ) && count( $errors ) > 0 ) { | |
| 59 | 50 | ?> |
| 60 | 51 | <div class="frm_error_style inline" role="alert"> |
| 61 | 52 | <ul id="frm_errors"> |
| 62 | 53 | <?php |
| @@ -66,22 +57,5 @@ | ||
| 66 | 57 | ?> |
| 67 | 58 | </ul> |
| 68 | 59 | </div> |
| 69 | 60 | <?php |
| 70 | -} | |
| 71 | - | |
| 72 | -if ( ! empty( $notes ) && is_array( $notes ) ) { | |
| 73 | - foreach ( $notes as $note ) { | |
| 74 | - ?> | |
| 75 | - <div class="frm_note_style"> | |
| 76 | - <?php | |
| 77 | - if ( is_string( $note ) ) { | |
| 78 | - echo esc_html( $note ); | |
| 79 | - } elseif ( is_callable( $note ) ) { | |
| 80 | - // If $note is a function call it so we can handle cases where we don't want to wrap the whole note in esc_html. | |
| 81 | - $note(); | |
| 82 | - } | |
| 83 | - ?> | |
| 84 | - </div> | |
| 85 | - <?php | |
| 86 | - } | |
| 87 | 61 | } |