| @@ -30,16 +30,15 @@ | ||
| 30 | 30 | $settings = $this->get_settings_for_display(); |
| 31 | 31 | $fields = $settings['fields']; |
| 32 | 32 | $has_address = false; |
| 33 | 33 | |
| 34 | - $attr_messages = ''; | |
| 34 | + $messages = ''; | |
| 35 | + | |
| 35 | 36 | if ( 'yes' === $settings['messages_custom'] ) { |
| 36 | 37 | $messages = esc_attr( wp_json_encode( [ |
| 37 | 38 | 'error' => esc_attr( $settings['messages_error'] ), |
| 38 | 39 | 'required' => esc_attr( $settings['messages_required'] ), |
| 39 | 40 | ] ) ); |
| 40 | - | |
| 41 | - $attr_messages = "data-messages=\"{$messages}\""; | |
| 42 | 41 | } |
| 43 | 42 | |
| 44 | 43 | ?> |
| 45 | 44 | <form |
| @@ -44,14 +43,14 @@ | ||
| 44 | 43 | ?> |
| 45 | 44 | <form |
| 46 | 45 | novalidate |
| 47 | 46 | method="POST" |
| 48 | - name="optin-<?php echo $this->get_id(); ?>" | |
| 47 | + name="optin-<?php echo esc_attr( $this->get_id() ); ?>" | |
| 49 | 48 | onsubmit="(e)=>e.preventDefault()" |
| 50 | 49 | class="sellkit-optin sellkit-flex sellkit-flex-wrap sellkit-flex-bottom" |
| 51 | - <?php echo $attr_messages; ?>> | |
| 52 | - <input type="hidden" name="post_id" value="<?php echo self::get_current_post_id(); ?>" /> | |
| 53 | - <input type="hidden" name="form_id" value="<?php echo $this->get_id(); ?>" /> | |
| 50 | + data-messages=<?php echo '"' . esc_attr( $messages ) . '"'; ?>> | |
| 51 | + <input type="hidden" name="post_id" value="<?php echo esc_attr( self::get_current_post_id() ); ?>" /> | |
| 52 | + <input type="hidden" name="form_id" value="<?php echo esc_attr( $this->get_id() ); ?>" /> | |
| 54 | 53 | <?php |
| 55 | 54 | |
| 56 | 55 | foreach ( $fields as $field ) { |
| 57 | 56 | if ( 'address' === $field['type'] ) { |
| @@ -61,9 +60,9 @@ | ||
| 61 | 60 | Module::render_field( $this, $field ); |
| 62 | 61 | } |
| 63 | 62 | |
| 64 | 63 | ?> |
| 65 | - <div <?php echo $this->button_wrapper_attributes( $settings ); ?>> | |
| 64 | + <div <?php echo $this->button_wrapper_attributes( $settings ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. ?>> | |
| 66 | 65 | <button type="submit" class="sellkit-submit-button"> |
| 67 | 66 | <?php Module::render_icon( $settings['submit_button_icon'] ); ?> |
| 68 | 67 | <div class="sellkit-submit-button-texts"> |
| 69 | 68 | <span class="sellkit-submit-button-text"> |