| @@ -1,5 +1,16 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * Form errors and success message wrapper. | |
| 4 | + * | |
| 5 | + * @package Formidable | |
| 6 | + * | |
| 7 | + * @var stdClass|null $form Form object when available. | |
| 8 | + * @var string|null $message Success message HTML. | |
| 9 | + * @var array|null $errors Field errors keyed by field id. | |
| 10 | + * @var string|null $include_extra_container Optional CSS class for a wrapping container. | |
| 11 | + */ | |
| 12 | + | |
| 2 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 14 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 15 | } |
| 5 | 16 | |
| @@ -7,8 +18,9 @@ | ||
| 7 | 18 | <div class="<?php echo esc_attr( $include_extra_container ); ?>" id="frm_form_<?php echo esc_attr( $form->id ); ?>_container"> |
| 8 | 19 | <?php |
| 9 | 20 | } |
| 10 | 21 | |
| 22 | +// phpcs:ignore Universal.Operators.StrictComparisons | |
| 11 | 23 | if ( isset( $message ) && $message != '' ) { |
| 12 | 24 | if ( FrmAppHelper::is_admin() ) { |
| 13 | 25 | ?> |
| 14 | 26 | <div id="message" class="frm_updated_message" role="status"><?php echo wp_kses_post( $message ); ?></div> |
| @@ -15,9 +27,9 @@ | ||
| 15 | 27 | <?php |
| 16 | 28 | } else { |
| 17 | 29 | FrmFormsHelper::maybe_get_scroll_js( $form->id ); |
| 18 | 30 | |
| 19 | - // we need to allow scripts here for javascript in the success message | |
| 31 | + // We need to allow scripts here for javascript in the success message | |
| 20 | 32 | echo FrmAppHelper::maybe_kses( $message ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 21 | 33 | } |
| 22 | 34 | } |
| 23 | 35 | |
| @@ -32,9 +44,9 @@ | ||
| 32 | 44 | |
| 33 | 45 | if ( ! FrmAppHelper::is_admin() ) { |
| 34 | 46 | $img = apply_filters( 'frm_error_icon', $img ); |
| 35 | 47 | |
| 36 | - if ( $img && ! empty( $img ) ) { | |
| 48 | + if ( $img ) { | |
| 37 | 49 | echo '<img src="' . esc_url( $img ) . '" alt="" />'; |
| 38 | 50 | } |
| 39 | 51 | } |
| 40 | 52 | |