| @@ -1,50 +1,46 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - die( 'You are not allowed to call this page directly.' ); | |
| 4 | -} | |
| 5 | - | |
| 6 | 2 | if ( isset( $include_extra_container ) ) { ?> |
| 7 | -<div class="<?php echo esc_attr( $include_extra_container ); ?>" id="frm_form_<?php echo esc_attr( $form->id ); ?>_container"> | |
| 8 | - <?php | |
| 3 | +<div class="<?php echo esc_attr( $include_extra_container ) ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> | |
| 4 | +<?php | |
| 9 | 5 | } |
| 10 | 6 | if ( isset( $message ) && $message != '' ) { |
| 11 | - if ( FrmAppHelper::is_admin() ) { | |
| 12 | - ?> | |
| 13 | -<div id="message" class="frm_updated_message" role="status"><?php echo wp_kses_post( $message ); ?></div> | |
| 14 | - <?php | |
| 7 | + if ( FrmAppHelper::is_admin() ) { | |
| 8 | +?> | |
| 9 | +<div id="message" class="frm_updated_message"><?php echo wp_kses_post( $message ) ?></div> | |
| 10 | +<?php | |
| 15 | 11 | } else { |
| 16 | 12 | FrmFormsHelper::maybe_get_scroll_js( $form->id ); |
| 17 | 13 | |
| 18 | 14 | // we need to allow scripts here for javascript in the success message |
| 19 | - echo FrmAppHelper::maybe_kses( $message ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 20 | - } | |
| 15 | + echo $message; // WPCS: XSS ok. | |
| 16 | + } | |
| 21 | 17 | } |
| 22 | 18 | |
| 23 | 19 | if ( isset( $errors ) && is_array( $errors ) && ! empty( $errors ) ) { |
| 24 | 20 | |
| 25 | 21 | if ( isset( $form ) && is_object( $form ) ) { |
| 26 | - FrmFormsHelper::get_scroll_js( $form->id ); | |
| 22 | + FrmFormsHelper::get_scroll_js( $form->id ); | |
| 27 | 23 | } |
| 28 | 24 | ?> |
| 29 | -<div class="<?php echo esc_attr( FrmFormsHelper::form_error_class() ); ?>" role="alert"> | |
| 30 | - <?php | |
| 31 | - $img = ''; | |
| 32 | - if ( ! FrmAppHelper::is_admin() ) { | |
| 33 | - $img = apply_filters( 'frm_error_icon', $img ); | |
| 34 | - if ( $img && ! empty( $img ) ) { | |
| 35 | - echo '<img src="' . esc_url( $img ) . '" alt="" />'; | |
| 36 | - } | |
| 37 | - } | |
| 25 | +<div class="<?php echo esc_attr( FrmFormsHelper::form_error_class() ) ?>"> | |
| 26 | +<?php | |
| 27 | +$img = ''; | |
| 28 | +if ( ! FrmAppHelper::is_admin() ) { | |
| 29 | + $img = apply_filters( 'frm_error_icon', $img ); | |
| 30 | + if ( $img && ! empty( $img ) ) { | |
| 31 | + echo '<img src="' . esc_url( $img ) . '" alt="" />'; | |
| 32 | + } | |
| 33 | +} | |
| 38 | 34 | |
| 39 | - FrmFormsHelper::show_errors( compact( 'img', 'errors', 'form' ) ); | |
| 35 | +FrmFormsHelper::show_errors( compact( 'img', 'errors', 'form' ) ); | |
| 40 | 36 | |
| 41 | - ?> | |
| 37 | +?> | |
| 42 | 38 | </div> |
| 43 | - <?php | |
| 39 | +<?php | |
| 44 | 40 | } |
| 45 | 41 | |
| 46 | 42 | if ( isset( $include_extra_container ) ) { |
| 47 | - ?> | |
| 43 | +?> | |
| 48 | 44 | </div> |
| 49 | - <?php | |
| 45 | +<?php | |
| 50 | 46 | } |