| @@ -1,49 +1,73 @@ | ||
| 1 | -<form id="acym_form" action="<?php echo acym_completeLink(acym_getVar('cmd', 'ctrl')); ?>" method="post" name="acyForm" data-abide novalidate> | |
| 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 | + | |
| 5 | +$summaryAllowedTags = [ | |
| 6 | + 'br' => [], | |
| 7 | + 'b' => [], | |
| 8 | + 'strong' => [], | |
| 9 | + 'i' => [], | |
| 10 | + 'em' => [], | |
| 11 | + 'p' => [], | |
| 12 | + 'span' => ['class' => true], | |
| 13 | +]; | |
| 14 | +?> | |
| 15 | +<form id="acym_form" action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>" method="post" name="acyForm" data-abide novalidate> | |
| 2 | 16 | <input type="hidden" name="id" value="<?php echo empty($data['id']) ? '' : intval($data['id']); ?>"> |
| 3 | 17 | <div class="cell grid-x"> |
| 4 | 18 | <div class="cell auto"></div> |
| 5 | 19 | <div class="acym__content grid-x cell xxlarge-7 xlarge-9" id="acym__automation__summary"> |
| 6 | 20 | <?php |
| 7 | - echo $data['workflowHelper']->display($this->steps, 'summary'); | |
| 21 | + $data['workflowHelper']->display($this->steps, 'summary'); | |
| 8 | 22 | if (!empty($data['id'])) { |
| 9 | 23 | ?> |
| 10 | 24 | <div class="acym__automation__summary__info cell grid-x acym__content margin-top-2"> |
| 11 | - <h6 class="cell acym__title acym__title__secondary"><?php echo acym_translation('ACYM_INFORMATION'); ?></h6> | |
| 25 | + <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_INFORMATION')); ?></h6> | |
| 12 | 26 | <?php if (!empty($data['automation']->admin)) { |
| 13 | 27 | $data['automation']->name = acym_translation($data['automation']->name); |
| 14 | 28 | $data['automation']->description = acym_translation($data['automation']->description); |
| 15 | 29 | } ?> |
| 16 | - <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo acym_translation( | |
| 17 | - 'ACYM_NAME_SUMMARY' | |
| 18 | - ); ?></span> : <?php echo acym_escape($data['automation']->name); ?></div> | |
| 19 | - <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo acym_translation( | |
| 20 | - 'ACYM_DESCRIPTION' | |
| 21 | - ); ?></span> : <?php echo acym_escape($data['automation']->description); ?></div> | |
| 30 | + <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo esc_html( | |
| 31 | + acym_translation( | |
| 32 | + 'ACYM_NAME_SUMMARY' | |
| 33 | + ) | |
| 34 | + ); ?></span> : <?php echo esc_html($data['automation']->name); ?></div> | |
| 35 | + <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo esc_html( | |
| 36 | + acym_translation( | |
| 37 | + 'ACYM_DESCRIPTION' | |
| 38 | + ) | |
| 39 | + ); ?></span> : <?php echo esc_html($data['automation']->description); ?></div> | |
| 22 | 40 | </div> |
| 23 | 41 | <div class="acym__automation__summary__filters cell grid-x margin-top-2 acym__content"> |
| 24 | - <h6 class="cell acym__title acym__title__secondary"><?php echo acym_translation('ACYM_TRIGGERS'); ?></h6> | |
| 25 | - <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo acym_translation( | |
| 26 | - 'ACYM_AUTOMATION_TRIGGER' | |
| 42 | + <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_TRIGGERS')); ?></h6> | |
| 43 | + <div class="cell acym__automation__summary__information__one"><span class="acym__automation__summary__information__one__title"><?php echo esc_html( | |
| 44 | + acym_translation( | |
| 45 | + 'ACYM_AUTOMATION_TRIGGER' | |
| 46 | + ) | |
| 27 | 47 | ); ?></span></div> |
| 28 | 48 | <br /> |
| 29 | 49 | <div class="cell acym__automation__summary__information__one"> |
| 30 | 50 | <?php |
| 31 | - foreach ($data['step']->triggers as $name => $oneTrigger) { | |
| 32 | - if (!is_string($oneTrigger)) { | |
| 33 | - $data['step']->triggers[$name] = acym_translation('ACYM_UNKNOWN'); | |
| 51 | + $triggerNum = 0; | |
| 52 | + foreach ($data['step']->triggers as $oneTrigger) { | |
| 53 | + if ($triggerNum > 0) { | |
| 54 | + echo '<br /><span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 55 | + acym_translation('ACYM_OR') | |
| 56 | + ).'</span><br />'; | |
| 34 | 57 | } |
| 58 | + | |
| 59 | + echo wp_kses( | |
| 60 | + is_string($oneTrigger) ? $oneTrigger : acym_translation('ACYM_UNKNOWN'), | |
| 61 | + $summaryAllowedTags | |
| 62 | + ); | |
| 63 | + $triggerNum++; | |
| 35 | 64 | } |
| 36 | - | |
| 37 | - echo implode( | |
| 38 | - '<br /><span class="acym__automation__summary__information__one__title">'.acym_translation('ACYM_OR').'</span><br />', | |
| 39 | - $data['step']->triggers | |
| 40 | - ); | |
| 41 | 65 | ?> |
| 42 | 66 | </div> |
| 43 | 67 | </div> |
| 44 | 68 | <div class="acym__automation__summary__actions cell grid-x margin-top-2 acym__content"> |
| 45 | - <h6 class="cell acym__title acym__title__secondary"><?php echo acym_translation('ACYM_CONDITIONS'); ?></h6> | |
| 69 | + <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_CONDITIONS')); ?></h6> | |
| 46 | 70 | <div class="cell acym__automation__summary__information__one grid-x"> |
| 47 | 71 | <?php |
| 48 | 72 | if (!empty($data['condition']->conditions)) { |
| 49 | 73 | $orNum = 0; |
| @@ -50,23 +74,34 @@ | ||
| 50 | 74 | $andNum = 0; |
| 51 | 75 | $typeTrigger = $data['condition']->conditions['type_condition']; |
| 52 | 76 | unset($data['condition']->conditions['type_condition']); |
| 53 | 77 | if (empty($data['condition']->conditions)) { |
| 54 | - echo '<span class="acym__automation__summary__information__one__title">'.acym_translation( | |
| 55 | - 'ACYM_YOU_DID_NOT_SET_CONDITION' | |
| 78 | + echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 79 | + acym_translation( | |
| 80 | + 'ACYM_YOU_DID_NOT_SET_CONDITION' | |
| 81 | + ) | |
| 56 | 82 | ).'</span></div><div class="acym__automation__summary__information__one">'; |
| 57 | 83 | } else { |
| 58 | - echo '<span class="acym__automation__summary__information__one__title">'.acym_translationSprintf( | |
| 59 | - 'ACYM_CONDITIONS_APPLY_TO', | |
| 60 | - acym_translation($typeTrigger == 'classic' ? '' : 'ACYM_ONE_ACYMAILING_SUBSCRIBER_CONDITION') | |
| 84 | + echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 85 | + acym_translationSprintf( | |
| 86 | + 'ACYM_CONDITIONS_APPLY_TO', | |
| 87 | + acym_translation($typeTrigger == 'classic' ? '' : 'ACYM_ONE_ACYMAILING_SUBSCRIBER_CONDITION') | |
| 88 | + ) | |
| 61 | 89 | ).'</span></div><div class="acym__automation__summary__information__one">'; |
| 62 | 90 | foreach ($data['condition']->conditions as $or => $orValues) { |
| 63 | 91 | if ($or === 'type_condition') continue; |
| 64 | 92 | $andNum = 0; |
| 65 | - if ($orNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.acym_translation('ACYM_OR').'</span><br />'; | |
| 93 | + if ($orNum > 0) { | |
| 94 | + echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 95 | + acym_translation('ACYM_OR') | |
| 96 | + ).'</span><br />'; | |
| 97 | + } | |
| 66 | 98 | foreach ($orValues as $and => $andValue) { |
| 67 | - if ($andNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.acym_translation('ACYM_AND').'</span><br />'; | |
| 68 | - echo $andValue.'<br />'; | |
| 99 | + if (is_array($andValue)) continue; | |
| 100 | + if ($andNum > 0) { | |
| 101 | + echo '<span class="acym__automation__summary__information__one__title">'.esc_html(acym_translation('ACYM_AND')).'</span><br />'; | |
| 102 | + } | |
| 103 | + echo wp_kses((string)$andValue, $summaryAllowedTags).'<br />'; | |
| 69 | 104 | $andNum++; |
| 70 | 105 | } |
| 71 | 106 | $orNum++; |
| 72 | 107 | } |
| @@ -71,9 +106,9 @@ | ||
| 71 | 106 | $orNum++; |
| 72 | 107 | } |
| 73 | 108 | } |
| 74 | 109 | } else { |
| 75 | - echo '<strong class="acym__color__red cell text-center">'.acym_translation('ACYM_SELECT_CONDITIONS').'</strong>'; | |
| 110 | + echo '<strong class="acym__color__red cell text-center">'.esc_html(acym_translation('ACYM_SELECT_CONDITIONS')).'</strong>'; | |
| 76 | 111 | } |
| 77 | 112 | ?> |
| 78 | 113 | </div> |
| 79 | 114 | </div> |
| @@ -78,53 +113,63 @@ | ||
| 78 | 113 | </div> |
| 79 | 114 | </div> |
| 80 | 115 | <?php } ?> |
| 81 | 116 | <div class="acym__automation__summary__actions cell grid-x margin-top-2 margin-bottom-2 acym__content"> |
| 82 | - <h6 class="cell acym__title acym__title__secondary"><?php echo acym_translation('ACYM_ACTIONS'); ?></h6> | |
| 117 | + <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ACTIONS')); ?></h6> | |
| 83 | 118 | <div class="cell acym__automation__summary__information__one grid-x"> |
| 84 | 119 | <?php |
| 85 | 120 | if (!empty($data['action']->actions)) { |
| 86 | - echo '<span class="acym__automation__summary__information__one__title">'.acym_translationSprintf( | |
| 87 | - 'ACYM_ACTIONS_SUBSCRIBER_WILL', | |
| 88 | - acym_strtolower(acym_translation(empty($data['id']) ? 'ACYM_MASS_ACTION' : 'ACYM_AUTOMATION')) | |
| 121 | + echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 122 | + acym_translationSprintf( | |
| 123 | + 'ACYM_ACTIONS_SUBSCRIBER_WILL', | |
| 124 | + acym_strtolower(acym_translation(empty($data['id']) ? 'ACYM_MASS_ACTION' : 'ACYM_AUTOMATION')) | |
| 125 | + ) | |
| 89 | 126 | ).'</span></div><div class="acym__automation__summary__information__one">'; |
| 90 | 127 | $andNum = 0; |
| 91 | 128 | foreach ($data['action']->actions as $and => $andValue) { |
| 92 | - if ($andNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.acym_translation('ACYM_AND').'</span><br />'; | |
| 93 | - echo $andValue.'<br />'; | |
| 129 | + if (is_array($andValue)) continue; | |
| 130 | + if ($andNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.esc_html(acym_translation('ACYM_AND')).'</span><br />'; | |
| 131 | + echo wp_kses((string)$andValue, $summaryAllowedTags).'<br />'; | |
| 94 | 132 | $andNum++; |
| 95 | 133 | } |
| 96 | 134 | } else { |
| 97 | - echo '<strong class="acym__color__red cell text-center">'.acym_translation('ACYM_SELECT_ACTIONS').'</strong>'; | |
| 135 | + echo '<strong class="acym__color__red cell text-center">'.esc_html(acym_translation('ACYM_SELECT_ACTIONS')).'</strong>'; | |
| 98 | 136 | } |
| 99 | 137 | ?> |
| 100 | 138 | </div> |
| 101 | 139 | </div> |
| 102 | 140 | <div class="acym__automation__summary__actions cell grid-x margin-top-1 margin-bottom-2 acym__content"> |
| 103 | - <h6 class="cell acym__title acym__title__secondary"><?php echo acym_translation('ACYM_ACTIONS_TARGETS'); ?></h6> | |
| 141 | + <h6 class="cell acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_ACTIONS_TARGETS')); ?></h6> | |
| 104 | 142 | <div class="cell acym__automation__summary__information__one grid-x"> |
| 105 | 143 | <?php |
| 106 | 144 | if (!empty($data['action']->filters)) { |
| 107 | 145 | $orNum = 0; |
| 108 | 146 | $andNum = 0; |
| 109 | - echo '<span class="acym__automation__summary__information__one__title">'.acym_translationSprintf( | |
| 110 | - 'ACYM_FILTERS_APPLY_TO', | |
| 111 | - acym_strtolower(acym_translation(empty($data['id']) ? 'ACYM_MASS_ACTION' : 'ACYM_AUTOMATION')), | |
| 112 | - acym_translation($data['action']->filters['type_filter'] == 'classic' ? 'ACYM_ALL_ACYMAILING_USERS' : 'ACYM_ONE_ACYMAILING_USER') | |
| 147 | + echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 148 | + acym_translationSprintf( | |
| 149 | + 'ACYM_FILTERS_APPLY_TO', | |
| 150 | + acym_strtolower(acym_translation(empty($data['id']) ? 'ACYM_MASS_ACTION' : 'ACYM_AUTOMATION')), | |
| 151 | + acym_translation($data['action']->filters['type_filter'] == 'classic' ? 'ACYM_ALL_ACYMAILING_USERS' : 'ACYM_ONE_ACYMAILING_USER') | |
| 152 | + ) | |
| 113 | 153 | ).'</span></div><div class="acym__automation__summary__information__one">'; |
| 114 | 154 | foreach ($data['action']->filters as $or => $orValues) { |
| 115 | 155 | if ($or === 'type_filter') continue; |
| 116 | 156 | $andNum = 0; |
| 117 | - if ($orNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.acym_translation('ACYM_OR').'</span><br />'; | |
| 157 | + if ($orNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.esc_html(acym_translation('ACYM_OR')).'</span><br />'; | |
| 118 | 158 | foreach ($orValues as $and => $andValue) { |
| 119 | - if ($andNum > 0) echo '<span class="acym__automation__summary__information__one__title">'.acym_translation('ACYM_AND').'</span><br />'; | |
| 120 | - echo $andValue.'<br />'; | |
| 159 | + if (is_array($andValue)) continue; | |
| 160 | + if ($andNum > 0) { | |
| 161 | + echo '<span class="acym__automation__summary__information__one__title">'.esc_html( | |
| 162 | + acym_translation('ACYM_AND') | |
| 163 | + ).'</span><br />'; | |
| 164 | + } | |
| 165 | + echo wp_kses((string)$andValue, $summaryAllowedTags).'<br />'; | |
| 121 | 166 | $andNum++; |
| 122 | 167 | } |
| 123 | 168 | $orNum++; |
| 124 | 169 | } |
| 125 | 170 | } else { |
| 126 | - echo '<strong class="acym__color__red cell text-center">'.acym_translation('ACYM_SELECT_FILTERS').'</strong>'; | |
| 171 | + echo '<strong class="acym__color__red cell text-center">'.esc_html(acym_translation('ACYM_SELECT_FILTERS')).'</strong>'; | |
| 127 | 172 | } |
| 128 | 173 | ?> |
| 129 | 174 | </div> |
| 130 | 175 | </div> |
| @@ -130,18 +175,26 @@ | ||
| 130 | 175 | </div> |
| 131 | 176 | <div class="cell grid-x grid-margin-x"> |
| 132 | 177 | <div class="auto cell"></div> |
| 133 | 178 | <?php if (empty($data['id'])) { ?> |
| 134 | - <button type="button" data-task="listing" class="cell shrink button-secondary button acy_button_submit"><?php echo acym_translation('ACYM_CANCEL'); ?></button> | |
| 135 | - <button type="button" data-task="processMassAction" class="cell shrink button acy_button_submit"><?php echo acym_translation( | |
| 136 | - 'ACYM_PROCESS_MASS_ACTION' | |
| 179 | + <button type="button" data-task="listing" class="cell shrink button-secondary button acy_button_submit"><?php echo esc_html( | |
| 180 | + acym_translation('ACYM_CANCEL') | |
| 137 | 181 | ); ?></button> |
| 182 | + <button type="button" data-task="processMassAction" class="cell shrink button acy_button_submit"><?php echo esc_html( | |
| 183 | + acym_translation( | |
| 184 | + 'ACYM_PROCESS_MASS_ACTION' | |
| 185 | + ) | |
| 186 | + ); ?></button> | |
| 138 | 187 | <?php } else { ?> |
| 139 | - <button type="button" data-task="listing" class="cell shrink button button-secondary acy_button_submit"><?php echo acym_translation( | |
| 140 | - 'ACYM_SAVE_EXIT' | |
| 188 | + <button type="button" data-task="listing" class="cell shrink button button-secondary acy_button_submit"><?php echo esc_html( | |
| 189 | + acym_translation( | |
| 190 | + 'ACYM_SAVE_EXIT' | |
| 191 | + ) | |
| 141 | 192 | ); ?></button> |
| 142 | - <button type="button" data-task="activeAutomation" class="cell shrink button acy_button_submit"><?php echo acym_translation( | |
| 143 | - 'ACYM_ACTIVE_AUTOMATION' | |
| 193 | + <button type="button" data-task="activeAutomation" class="cell shrink button acy_button_submit"><?php echo esc_html( | |
| 194 | + acym_translation( | |
| 195 | + 'ACYM_ACTIVE_AUTOMATION' | |
| 196 | + ) | |
| 144 | 197 | ); ?></button> |
| 145 | 198 | <?php } ?> |
| 146 | 199 | </div> |
| 147 | 200 | </div> |