| @@ -1,87 +1,25 @@ | ||
| 1 | +<div class="clear"></div> | |
| 1 | 2 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - die( 'You are not allowed to call this page directly.' ); | |
| 4 | -} | |
| 5 | - | |
| 6 | 3 | if ( isset( $message ) && '' !== $message ) { |
| 7 | 4 | if ( FrmAppHelper::is_admin() ) { |
| 8 | - echo '<div class="frm_updated_message">'; | |
| 9 | - FrmAppHelper::kses_echo( $message, 'all' ); | |
| 5 | + echo '<div id="message" class="frm_updated_message">'; | |
| 6 | + echo FrmAppHelper::kses( $message, 'all' ); // WPCS: XSS ok. | |
| 10 | 7 | echo '</div>'; |
| 11 | 8 | } else { |
| 12 | - echo FrmAppHelper::maybe_kses( $message ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 9 | + echo $message; // WPCS: XSS ok. | |
| 13 | 10 | } |
| 14 | 11 | } |
| 15 | 12 | |
| 16 | -if ( ! isset( $show_messages ) ) { | |
| 17 | - $show_messages = array(); | |
| 18 | -} | |
| 19 | -$show_messages = apply_filters( 'frm_message_list', $show_messages ); | |
| 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 | - ?> | |
| 27 | - <div class="frm_warning_style" role="alert"> | |
| 28 | - <ul id="frm_messages"> | |
| 29 | - <?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 | - 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 | |
| 34 | - } | |
| 35 | - // Remove the callback function from the 'frm_striphtml_allowed_tags' filter | |
| 36 | - remove_filter( 'frm_striphtml_allowed_tags', $add_data_action_callback ); | |
| 37 | - ?> | |
| 38 | - </ul> | |
| 39 | - </div> | |
| 40 | - <?php | |
| 41 | -}//end if | |
| 42 | - | |
| 43 | -if ( ! empty( $warnings ) && is_array( $warnings ) ) { | |
| 44 | - ?> | |
| 45 | - <div class="frm_warning_style inline" role="alert"> | |
| 46 | - <div class="frm_warning_heading"> <?php echo esc_html__( 'Warning:', 'formidable' ); ?></div> | |
| 47 | - <ul id="frm_warnings"> | |
| 48 | - <?php | |
| 49 | - foreach ( $warnings as $warning ) { | |
| 50 | - echo '<li>' . FrmAppHelper::kses( $warning, array( 'a', 'br' ) ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 51 | - } | |
| 52 | - ?> | |
| 53 | - </ul> | |
| 54 | - </div> | |
| 55 | - <?php | |
| 56 | -} | |
| 57 | - | |
| 58 | -if ( ! empty( $errors ) && is_array( $errors ) ) { | |
| 59 | - ?> | |
| 60 | - <div class="frm_error_style inline" role="alert"> | |
| 13 | +if ( isset( $errors ) && is_array( $errors ) && count( $errors ) > 0 ) { | |
| 14 | +?> | |
| 15 | + <div class="error frm_error_style inline" role="alert"> | |
| 61 | 16 | <ul id="frm_errors"> |
| 62 | 17 | <?php |
| 63 | 18 | foreach ( $errors as $error ) { |
| 64 | - echo '<li>' . FrmAppHelper::kses( $error, array( 'a', 'br' ) ) . '</li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 19 | + echo '<li>' . FrmAppHelper::kses( $error, array( 'a', 'br' ) ) . '</li>'; // WPCS: XSS ok. | |
| 65 | 20 | } |
| 66 | 21 | ?> |
| 67 | 22 | </ul> |
| 68 | 23 | </div> |
| 69 | - <?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 | - } | |
| 24 | +<?php | |
| 87 | 25 | } |