| @@ -1,53 +1,58 @@ | ||
| 1 | +<?php | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | +?> | |
| 1 | 5 | <div class="acym__subscription__form__fields"> |
| 2 | 6 | <?php |
| 3 | 7 | $config = acym_config(); |
| 4 | 8 | if ($form->settings['lists']['display_position'] === 'before') { |
| 5 | 9 | if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-lists') { |
| 6 | - echo '<p id="acym__subscription__form__popup-text">'.acym_translation($form->settings['message']['text']).'</p>'; | |
| 10 | + echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; | |
| 7 | 11 | } |
| 8 | 12 | include acym_getPartial('forms', 'lists'); |
| 9 | 13 | } |
| 10 | 14 | if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-fields') { |
| 11 | - echo '<p id="acym__subscription__form__popup-text">'.acym_translation($form->settings['message']['text']).'</p>'; | |
| 15 | + echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; | |
| 12 | 16 | } |
| 13 | 17 | foreach ($form->settings['fields']['displayed'] as $field) { |
| 14 | - echo '<div class="onefield fieldacy'.$field->id.' acyfield_'.$field->type.'" id="field_'.$field->id.'">'; | |
| 15 | - echo $form->fieldClass->displayField($field, $field->default_value, $field->valuesArray, $form->settings['fields']['display_mode'] === 'outside', true); | |
| 18 | + echo '<div class="onefield fieldacy'.esc_attr($field->id).' acyfield_'.esc_attr($field->type).'" id="field_'.esc_attr($field->id).'">'; | |
| 19 | + $form->fieldClass->displayField($field, $field->default_value, $field->valuesArray, $form->settings['fields']['display_mode'] === 'outside', true); | |
| 16 | 20 | echo '</div>'; |
| 17 | 21 | |
| 18 | 22 | if ($field->id == 2 && $config->get('email_confirmation')) { |
| 19 | - echo $form->fieldClass->setEmailConfirmationField($form->settings['fields']['display_mode'] === 'outside', $field); | |
| 23 | + $form->fieldClass->setEmailConfirmationField($form->settings['fields']['display_mode'] === 'outside', $field); | |
| 20 | 24 | } |
| 21 | 25 | } |
| 22 | 26 | if ($form->settings['lists']['display_position'] === 'after') { |
| 23 | 27 | if ($form->type === $form->formClass::SUB_FORM_TYPE_POPUP && !empty($form->settings['message']['text']) && $form->settings['message']['position'] === 'before-lists') { |
| 24 | - echo '<p id="acym__subscription__form__popup-text">'.acym_translation($form->settings['message']['text']).'</p>'; | |
| 28 | + echo '<p id="acym__subscription__form__popup-text">'.esc_html(acym_translation($form->settings['message']['text'])).'</p>'; | |
| 25 | 29 | } |
| 26 | 30 | include acym_getPartial('forms', 'lists'); |
| 27 | 31 | } |
| 28 | 32 | include acym_getPartial('forms', 'termspolicy'); |
| 33 | + include acym_getPartial('forms', 'tracking_consent'); | |
| 29 | 34 | include acym_getPartial('forms', 'recaptcha'); |
| 30 | 35 | ?> |
| 31 | 36 | <style> |
| 32 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields{ | |
| 37 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields{ | |
| 33 | 38 | display: flex; |
| 34 | 39 | justify-content: center; |
| 35 | 40 | align-items: center |
| 36 | 41 | } |
| 37 | 42 | |
| 38 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields > *{ | |
| 43 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields > *{ | |
| 39 | 44 | margin: <?php echo in_array($form->type, [$form->formClass::SUB_FORM_TYPE_FOOTER, $form->formClass::SUB_FORM_TYPE_HEADER]) ? 'auto 10px' : '10px auto'; ?> !important; |
| 40 | 45 | } |
| 41 | 46 | |
| 42 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .onefield{ | |
| 47 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield{ | |
| 43 | 48 | width: 100%; |
| 44 | 49 | box-sizing: border-box |
| 45 | 50 | } |
| 46 | 51 | |
| 47 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .onefield input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), | |
| 48 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .onefield select, | |
| 49 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .onefield textarea{ | |
| 52 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), | |
| 53 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield select, | |
| 54 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield textarea{ | |
| 50 | 55 | display: block; |
| 51 | 56 | width: <?php echo intval($form->settings['fields']['fields_width']) ?? 100; ?>%; |
| 52 | 57 | margin-left: auto; |
| 53 | 58 | margin-right: auto; |
| @@ -55,11 +60,11 @@ | ||
| 55 | 60 | box-sizing: border-box |
| 56 | 61 | } |
| 57 | 62 | |
| 58 | 63 | @media screen and (max-width: 768px){ |
| 59 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .onefield input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), | |
| 60 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .onefield select, | |
| 61 | - <?php echo '#acym_fulldiv_'.$form->form_tag_name.' '; ?>.acym__subscription__form__fields .onefield textarea{ | |
| 64 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), | |
| 65 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield select, | |
| 66 | + <?php echo '#acym_fulldiv_'.esc_html($form->form_tag_name).' '; ?>.acym__subscription__form__fields .onefield textarea{ | |
| 62 | 67 | width: 100% |
| 63 | 68 | } |
| 64 | 69 | } |
| 65 | 70 | </style> |