| @@ -1,12 +1,16 @@ | ||
| 1 | -<input type="hidden" id="acym__config__mail__embed__image__blocked" value="<?php echo acym_escape($data['embedImage']); ?>"> | |
| 2 | -<input type="hidden" id="acym__config__mail__embed__attachment__blocked" value="<?php echo acym_escape($data['embedAttachment']); ?>"> | |
| 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 | +<input type="hidden" id="acym__config__mail__embed__image__blocked" value="<?php echo esc_attr(json_encode($data['embedImage'])); ?>"> | |
| 6 | +<input type="hidden" id="acym__config__mail__embed__attachment__blocked" value="<?php echo esc_attr(json_encode($data['embedAttachment'])); ?>"> | |
| 3 | 7 | <div class="acym__content acym_area padding-vertical-1 padding-horizontal-2"> |
| 4 | 8 | <div class="cell acym__config__mail-default"> |
| 5 | - <div class="acym__title acym__title__secondary"><?php echo acym_translation('ACYM_DEFAULT_SENDER'); ?></div> | |
| 9 | + <div class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_DEFAULT_SENDER')); ?></div> | |
| 6 | 10 | <?php |
| 7 | 11 | if (!empty($data['translation_languages'])) { |
| 8 | - echo acym_displayLanguageRadio( | |
| 12 | + acym_displayLanguageRadio( | |
| 9 | 13 | $data['translation_languages'], |
| 10 | 14 | 'config[sender_info_translation]', |
| 11 | 15 | $this->config->get('sender_info_translation', ''), |
| 12 | 16 | acym_translation('ACYM_LANGUAGE_SENDER_INFORMATION_DESC'), |
| @@ -16,74 +20,84 @@ | ||
| 16 | 20 | } ?> |
| 17 | 21 | <div class="grid-x grid-margin-x margin-y"> |
| 18 | 22 | <div class="cell large-6 xlarge-4"> |
| 19 | 23 | <label class="cell grid-x"> |
| 20 | - <span class="cell"><?php echo acym_translation('ACYM_FROM_NAME').acym_info(['textShownInTooltip' => 'ACYM_FROM_DESC']); ?></span> | |
| 24 | + <span class="cell"><?php echo esc_html(acym_translation('ACYM_FROM_NAME')); | |
| 25 | + acym_info(['textShownInTooltip' => 'ACYM_FROM_DESC']); ?></span> | |
| 21 | 26 | <input type="text" |
| 22 | - name="config[from_name]" | |
| 23 | - placeholder="<?php echo acym_translation('ACYM_FROM_NAME_PLACEHOLDER'); ?>" | |
| 24 | - value="<?php echo acym_escape($this->config->get('from_name')); ?>" /> | |
| 27 | + name="config[from_name]" | |
| 28 | + placeholder="<?php echo esc_attr(acym_translation('ACYM_FROM_NAME_PLACEHOLDER')); ?>" | |
| 29 | + value="<?php echo esc_attr($this->config->get('from_name')); ?>" /> | |
| 25 | 30 | </label> |
| 26 | 31 | </div> |
| 27 | 32 | <div class="cell large-6 xlarge-4"> |
| 28 | 33 | <label class="cell grid-x"> |
| 29 | - <span class="cell"><?php echo acym_translation('ACYM_FROM_EMAIL').acym_info(['textShownInTooltip' => 'ACYM_FROM_DESC']); ?></span> | |
| 34 | + <span class="cell"><?php echo esc_html(acym_translation('ACYM_FROM_EMAIL')); | |
| 35 | + acym_info(['textShownInTooltip' => 'ACYM_FROM_DESC']); ?></span> | |
| 30 | 36 | <input type="email" |
| 31 | - name="config[from_email]" | |
| 32 | - placeholder="<?php echo acym_translation('ACYM_FROM_EMAIL_PLACEHOLDER'); ?>" | |
| 33 | - value="<?php echo acym_escape($this->config->get('from_email')); ?>" /> | |
| 37 | + name="config[from_email]" | |
| 38 | + placeholder="<?php echo esc_attr(acym_translation('ACYM_FROM_EMAIL_PLACEHOLDER')); ?>" | |
| 39 | + value="<?php echo esc_attr($this->config->get('from_email')); ?>" /> | |
| 34 | 40 | </label> |
| 35 | 41 | </div> |
| 36 | - <?php if (!empty($data['button_copy_settings_from'])) echo $data['button_copy_settings_from']; ?> | |
| 42 | + <?php | |
| 43 | + if (!empty($data['wp_mail_smtp_installed'])) { | |
| 44 | + $pluginClass = new AcymPlugin(); | |
| 45 | + $pluginClass->getCopySettingsButton($data, 'from_options', 'wp_mail_smtp'); | |
| 46 | + } | |
| 47 | + ?> | |
| 37 | 48 | <div class="cell margin-bottom-1 acym_vcenter"> |
| 38 | - <input type="hidden" id="from_as_replyto_value" name="config[from_as_replyto]" value="<?php echo acym_escape($this->config->get('from_as_replyto', 1)); ?>" /> | |
| 49 | + <input type="hidden" id="from_as_replyto_value" name="config[from_as_replyto]" value="<?php echo esc_attr($this->config->get('from_as_replyto', 1)); ?>" /> | |
| 39 | 50 | <input id="from_as_replyto" data-toggle="acy_toggle_replyto" data-value="from_as_replyto_value" class="acym_toggle" type="checkbox" <?php |
| 40 | - if ($this->config->get('from_as_replyto', 1) == 1) { | |
| 41 | - echo 'checked="checked"'; | |
| 42 | - } | |
| 51 | + checked($this->config->get('from_as_replyto', 1) == 1); | |
| 43 | 52 | ?>/> |
| 44 | 53 | <label for="from_as_replyto"> |
| 45 | - <?php echo acym_translation('ACYM_FROM_AS_REPLYTO'); ?> | |
| 54 | + <?php echo esc_html(acym_translation('ACYM_FROM_AS_REPLYTO')); ?> | |
| 46 | 55 | </label> |
| 47 | 56 | </div> |
| 48 | 57 | |
| 49 | 58 | <div class="cell large-6 xlarge-4 acy_toggle_replyto"> |
| 50 | 59 | <label class="cell grid-x"> |
| 51 | - <span class="cell"><?php echo acym_translation('ACYM_REPLYTO_NAME').acym_info(['textShownInTooltip' => 'ACYM_REPLYTO_DESC']); ?></span> | |
| 60 | + <span class="cell"><?php echo esc_html(acym_translation('ACYM_REPLYTO_NAME')); | |
| 61 | + acym_info(['textShownInTooltip' => 'ACYM_REPLYTO_DESC']); ?></span> | |
| 52 | 62 | <input type="text" |
| 53 | - name="config[replyto_name]" | |
| 54 | - placeholder="<?php echo acym_translation('ACYM_REPLYTO_NAME_PLACEHOLDER'); ?>" | |
| 55 | - value="<?php echo acym_escape($this->config->get('replyto_name')); ?>" /> | |
| 63 | + name="config[replyto_name]" | |
| 64 | + placeholder="<?php echo esc_attr(acym_translation('ACYM_REPLYTO_NAME_PLACEHOLDER')); ?>" | |
| 65 | + value="<?php echo esc_attr($this->config->get('replyto_name')); ?>" /> | |
| 56 | 66 | </label> |
| 57 | 67 | </div> |
| 58 | 68 | <div class="cell large-6 xlarge-4 acy_toggle_replyto"> |
| 59 | 69 | <label class="cell grid-x"> |
| 60 | - <span class="cell"><?php echo acym_translation('ACYM_REPLYTO_EMAIL').acym_info(['textShownInTooltip' => 'ACYM_REPLYTO_DESC']); ?></span> | |
| 70 | + <span class="cell"><?php echo esc_html(acym_translation('ACYM_REPLYTO_EMAIL')); | |
| 71 | + acym_info(['textShownInTooltip' => 'ACYM_REPLYTO_DESC']); ?></span> | |
| 61 | 72 | <input type="email" |
| 62 | - name="config[replyto_email]" | |
| 63 | - placeholder="<?php echo acym_translation('ACYM_REPLYTO_EMAIL_PLACEHOLDER'); ?>" | |
| 64 | - value="<?php echo acym_escape($this->config->get('replyto_email')); ?>" /> | |
| 73 | + name="config[replyto_email]" | |
| 74 | + placeholder="<?php echo esc_attr(acym_translation('ACYM_REPLYTO_EMAIL_PLACEHOLDER')); ?>" | |
| 75 | + value="<?php echo esc_attr($this->config->get('replyto_email')); ?>" /> | |
| 65 | 76 | </label> |
| 66 | 77 | </div> |
| 67 | 78 | |
| 68 | 79 | <div class="cell grid-x"> |
| 69 | 80 | <div class="cell medium-6 large-4 xlarge-3 grid-x"> |
| 70 | - <?php echo acym_switch( | |
| 71 | - 'config[add_names]', | |
| 72 | - $this->config->get('add_names'), | |
| 73 | - acym_translation('ACYM_ADD_NAMES').acym_info(['textShownInTooltip' => 'ACYM_ADD_NAMES_DESC']) | |
| 74 | - ); ?> | |
| 81 | + <?php | |
| 82 | + acym_switch([ | |
| 83 | + 'name' => 'config[add_names]', | |
| 84 | + 'value' => $this->config->get('add_names'), | |
| 85 | + 'label' => acym_translation('ACYM_ADD_NAMES'), | |
| 86 | + 'tip' => ['textShownInTooltip' => 'ACYM_ADD_NAMES_DESC'], | |
| 87 | + ]); ?> | |
| 75 | 88 | </div> |
| 76 | 89 | </div> |
| 77 | 90 | |
| 78 | 91 | <div class="cell grid-x"> |
| 79 | 92 | <label class="cell large-6 xlarge-4 grid-x"> |
| 80 | - <span class="cell"><?php echo acym_translation('ACYM_BOUNCE_EMAIL').acym_info(['textShownInTooltip' => 'ACYM_BOUNCE_ADDRESS_DESC']); ?></span> | |
| 93 | + <span class="cell"><?php echo esc_html(acym_translation('ACYM_BOUNCE_EMAIL')); | |
| 94 | + acym_info(['textShownInTooltip' => 'ACYM_BOUNCE_ADDRESS_DESC']); ?></span> | |
| 81 | 95 | <input type="text" |
| 82 | - name="config[bounce_email]" | |
| 83 | - placeholder="<?php echo acym_translation('ACYM_BOUNCE_EMAIL_PLACEHOLDER'); ?>" | |
| 84 | - value="<?php echo acym_escape($this->config->get('bounce_email')); ?>" | |
| 85 | - id="bounceAddress1" /> | |
| 96 | + name="config[bounce_email]" | |
| 97 | + placeholder="<?php echo esc_attr(acym_translation('ACYM_BOUNCE_EMAIL_PLACEHOLDER')); ?>" | |
| 98 | + value="<?php echo esc_attr($this->config->get('bounce_email')); ?>" | |
| 99 | + id="bounceAddress1" /> | |
| 86 | 100 | </label> |
| 87 | 101 | </div> |
| 88 | 102 | </div> |
| 89 | 103 | </div> |
| @@ -88,57 +102,57 @@ | ||
| 88 | 102 | </div> |
| 89 | 103 | </div> |
| 90 | 104 | |
| 91 | 105 | <div class="cell acym__configuration__mail-settings"> |
| 92 | - <div class="acym__title acym__title__secondary margin-top-3"><?php echo acym_translation('ACYM_CONFIGURATION_MAIL').acym_info( | |
| 93 | - ['textShownInTooltip' => 'ACYM_INTRO_MAIL_SETTINGS'] | |
| 94 | - ); ?></div> | |
| 106 | + <div class="acym__title acym__title__secondary margin-top-3"><?php echo esc_html(acym_translation('ACYM_CONFIGURATION_MAIL')); | |
| 107 | + acym_info( | |
| 108 | + ['textShownInTooltip' => 'ACYM_INTRO_MAIL_SETTINGS'] | |
| 109 | + ); ?></div> | |
| 95 | 110 | <?php include acym_getPartial('configuration', 'sending_methods'); ?> |
| 96 | 111 | </div> |
| 97 | 112 | </div> |
| 98 | 113 | |
| 99 | 114 | <div class="acym__content acym_area padding-vertical-1 padding-horizontal-2"> |
| 100 | - <div class="acym__title acym__title__secondary"><?php echo acym_translation('ACYM_EMAIL_EDITOR'); ?></div> | |
| 115 | + <div class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_EMAIL_EDITOR')); ?></div> | |
| 101 | 116 | <div class="grid-x margin-y"> |
| 102 | 117 | <div class="cell grid-x grid-margin-x"> |
| 103 | 118 | <?php |
| 104 | - echo acym_switch( | |
| 105 | - 'config[save_thumbnail]', | |
| 106 | - $this->config->get('save_thumbnail', 1), | |
| 107 | - acym_translation('ACYM_SAVE_TEMPLATE_THUMBNAIL').acym_info(['textShownInTooltip' => 'ACYM_SAVE_TEMPLATE_THUMBNAIL_DESC']), | |
| 108 | - [], | |
| 109 | - 'xlarge-3 medium-5 small-9' | |
| 110 | - ); | |
| 119 | + acym_switch([ | |
| 120 | + 'name' => 'config[save_thumbnail]', | |
| 121 | + 'value' => $this->config->get('save_thumbnail', 1), | |
| 122 | + 'label' => acym_translation('ACYM_SAVE_TEMPLATE_THUMBNAIL'), | |
| 123 | + 'tip' => ['textShownInTooltip' => 'ACYM_SAVE_TEMPLATE_THUMBNAIL_DESC'], | |
| 124 | + 'labelClass' => 'xlarge-3 medium-5 small-9', | |
| 125 | + ]); | |
| 111 | 126 | ?> |
| 112 | 127 | </div> |
| 113 | 128 | <?php if ($this->config->get('built_by_update', 0) == 1 || acym_level(ACYM_ESSENTIAL)) { ?> |
| 114 | 129 | <div class="cell grid-x grid-margin-x"> |
| 115 | 130 | <?php |
| 116 | - echo acym_switch( | |
| 117 | - 'config[display_built_by]', | |
| 118 | - $this->config->get('display_built_by', 0), | |
| 119 | - acym_translation('ACYM_ADD_BUILT_BY_FOOTER_UNSUB_PAGE'), | |
| 120 | - [], | |
| 121 | - 'xlarge-3 medium-5 small-9' | |
| 122 | - ); | |
| 131 | + acym_switch([ | |
| 132 | + 'name' => 'config[display_built_by]', | |
| 133 | + 'value' => $this->config->get('display_built_by', 0), | |
| 134 | + 'label' => html_entity_decode(acym_translation('ACYM_ADD_BUILT_BY_FOOTER_UNSUB_PAGE')), | |
| 135 | + 'labelClass' => 'xlarge-3 medium-5 small-9', | |
| 136 | + ]); | |
| 123 | 137 | ?> |
| 124 | 138 | </div> |
| 125 | 139 | <?php } ?> |
| 126 | 140 | <div class="cell grid-x grid-margin-x"> |
| 127 | 141 | <?php |
| 128 | - echo acym_switch( | |
| 129 | - 'config[add_play_button_video]', | |
| 130 | - $this->config->get('add_play_button_video', 1), | |
| 131 | - acym_translation('ACYM_ADD_PLAY_BUTTON'), | |
| 132 | - [], | |
| 133 | - 'xlarge-3 medium-5 small-9' | |
| 134 | - ); | |
| 142 | + acym_switch([ | |
| 143 | + 'name' => 'config[add_play_button_video]', | |
| 144 | + 'value' => $this->config->get('add_play_button_video', 1), | |
| 145 | + 'label' => acym_translation('ACYM_ADD_PLAY_BUTTON'), | |
| 146 | + 'labelClass' => 'xlarge-3 medium-5 small-9', | |
| 147 | + ]); | |
| 135 | 148 | ?> |
| 136 | 149 | </div> |
| 137 | 150 | <div class="cell grid-x"> |
| 138 | 151 | <label class="cell medium-6 grid-x"> |
| 139 | 152 | <span class="cell medium-6"> |
| 140 | - <?php echo acym_translation('ACYM_UNSPLASH_ACCESS_KEY').acym_info(['textShownInTooltip' => 'ACYM_UNSPLASH_ACCESS_KEY_DESC']); ?> | |
| 153 | + <?php echo esc_html(acym_translation('ACYM_UNSPLASH_ACCESS_KEY')); | |
| 154 | + acym_info(['textShownInTooltip' => 'ACYM_UNSPLASH_ACCESS_KEY_DESC']); ?> | |
| 141 | 155 | </span> |
| 142 | 156 | <?php |
| 143 | 157 | $unsplashKey = $this->config->get('unsplash_key'); |
| 144 | 158 | if (strlen($unsplashKey) > 5) { |
| @@ -145,17 +159,18 @@ | ||
| 145 | 159 | $unsplashKey = str_repeat('*', 10).substr($unsplashKey, -5); |
| 146 | 160 | } |
| 147 | 161 | ?> |
| 148 | 162 | <input type="text" |
| 149 | - name="config[unsplash_key]" | |
| 150 | - value="<?php echo acym_escape($unsplashKey); ?>" | |
| 151 | - class="cell medium-auto" /> | |
| 163 | + name="config[unsplash_key]" | |
| 164 | + value="<?php echo esc_attr($unsplashKey); ?>" | |
| 165 | + class="cell medium-auto" /> | |
| 152 | 166 | </label> |
| 153 | 167 | </div> |
| 154 | 168 | <div class="cell grid-x"> |
| 155 | 169 | <label class="cell medium-6 grid-x"> |
| 156 | 170 | <span class="cell medium-6"> |
| 157 | - <?php echo acym_translation('ACYM_GIPHY_API_KEY').acym_info(['textShownInTooltip' => 'ACYM_GIPHY_API_KEY_DESC']); ?> | |
| 171 | + <?php echo esc_html(acym_translation('ACYM_GIPHY_API_KEY')); | |
| 172 | + acym_info(['textShownInTooltip' => 'ACYM_GIPHY_API_KEY_DESC']); ?> | |
| 158 | 173 | </span> |
| 159 | 174 | <?php |
| 160 | 175 | $giphyKey = $this->config->get('giphy_key'); |
| 161 | 176 | if (strlen($giphyKey) > 5) { |
| @@ -162,11 +177,11 @@ | ||
| 162 | 177 | $giphyKey = str_repeat('*', 10).substr($giphyKey, -5); |
| 163 | 178 | } |
| 164 | 179 | ?> |
| 165 | 180 | <input type="text" |
| 166 | - name="config[giphy_key]" | |
| 167 | - value="<?php echo acym_escape($giphyKey); ?>" | |
| 168 | - class="cell medium-auto" /> | |
| 181 | + name="config[giphy_key]" | |
| 182 | + value="<?php echo esc_attr($giphyKey); ?>" | |
| 183 | + class="cell medium-auto" /> | |
| 169 | 184 | </label> |
| 170 | 185 | </div> |
| 171 | 186 | </div> |
| 172 | 187 | </div> |
| @@ -173,12 +188,12 @@ | ||
| 173 | 188 | |
| 174 | 189 | <div class="acym__content acym_area grid-x grid-margin-y padding-horizontal-2 acym__configuration__advanced"> |
| 175 | 190 | <div class="cell grid-x acym__configuration__showmore-head"> |
| 176 | 191 | <div class="acym__title acym__title__secondary cell auto margin-bottom-0"> |
| 177 | - <?php echo acym_translation('ACYM_CONFIGURATION_ADVANCED'); ?> | |
| 192 | + <?php echo esc_html(acym_translation('ACYM_CONFIGURATION_ADVANCED')); ?> | |
| 178 | 193 | </div> |
| 179 | 194 | <div class="cell shrink"> |
| 180 | - <?php echo acym_showMore('acym__configuration__mail__advanced__content'); ?> | |
| 195 | + <?php acym_showMore('acym__configuration__mail__advanced__content'); ?> | |
| 181 | 196 | </div> |
| 182 | 197 | </div> |
| 183 | 198 | <div id="acym__configuration__mail__advanced__content" style="display:none;"> |
| 184 | 199 | <div class="grid-x grid-margin-x margin-y"> |
| @@ -183,9 +198,9 @@ | ||
| 183 | 198 | <div id="acym__configuration__mail__advanced__content" style="display:none;"> |
| 184 | 199 | <div class="grid-x grid-margin-x margin-y"> |
| 185 | 200 | <div class="cell medium-6 grid-x"> |
| 186 | 201 | <div class="cell large-6"> |
| 187 | - <label for="config_encoding"><?php echo acym_translation('ACYM_CONFIGURATION_ENCODING'); ?></label> | |
| 202 | + <label for="config_encoding"><?php echo esc_html(acym_translation('ACYM_CONFIGURATION_ENCODING')); ?></label> | |
| 188 | 203 | </div> |
| 189 | 204 | <div class="cell large-6"> |
| 190 | 205 | <?php |
| 191 | 206 | $encodingHelper = $data['encodingHelper']; |
| @@ -195,16 +210,17 @@ | ||
| 195 | 210 | </div> |
| 196 | 211 | |
| 197 | 212 | <div class="cell medium-6 grid-x"> |
| 198 | 213 | <div class="cell large-6"> |
| 199 | - <label for="config_charset"><?php echo acym_translation('ACYM_CONFIGURATION_CHARSET'); ?></label> | |
| 214 | + <label for="config_charset"><?php echo esc_html(acym_translation('ACYM_CONFIGURATION_CHARSET')); ?></label> | |
| 200 | 215 | </div> |
| 201 | 216 | <div class="cell large-6"> |
| 202 | 217 | <?php |
| 203 | - echo $encodingHelper->charsetField( | |
| 218 | + $encodingHelper->charsetField( | |
| 204 | 219 | 'config[charset]', |
| 205 | 220 | $this->config->get('charset'), |
| 206 | - ['class' => 'acym__select'] | |
| 221 | + ['class' => 'acym__select'], | |
| 222 | + true | |
| 207 | 223 | ); |
| 208 | 224 | ?> |
| 209 | 225 | </div> |
| 210 | 226 | </div> |
| @@ -243,37 +259,36 @@ | ||
| 243 | 259 | $info = empty($option['info_disabled']) ? '' : '<span class="acym__configuration__mail__info__disabled">'.acym_translation($option['info_disabled']).'</span> '; |
| 244 | 260 | |
| 245 | 261 | $description = $label.'_DESC'; |
| 246 | 262 | $translatedDescription = acym_translation($description); |
| 247 | - $label = acym_translation($label); | |
| 248 | 263 | if ($translatedDescription !== $description) { |
| 249 | 264 | $info .= $translatedDescription; |
| 250 | 265 | } |
| 251 | 266 | |
| 252 | - if (!empty($info)) { | |
| 253 | - $info = acym_info(['textShownInTooltip' => $info]); | |
| 254 | - } | |
| 255 | - | |
| 256 | 267 | $default = empty($option['default']) ? 0 : $option['default']; |
| 257 | 268 | |
| 258 | - echo acym_switch( | |
| 259 | - 'config['.$oneOption.']', | |
| 260 | - $this->config->get($oneOption, $default), | |
| 261 | - $label.$info | |
| 262 | - ); | |
| 269 | + acym_switch([ | |
| 270 | + 'name' => 'config['.$oneOption.']', | |
| 271 | + 'value' => $this->config->get($oneOption, $default), | |
| 272 | + 'label' => acym_translation($label), | |
| 273 | + 'tip' => empty($info) ? null : ['textShownInTooltip' => $info], | |
| 274 | + ]); | |
| 263 | 275 | |
| 264 | 276 | echo '</div>'; |
| 265 | 277 | } |
| 266 | - | |
| 267 | - $style = $this->config->get('embed_files', 0) ? 'style="display:none;"' : ''; | |
| 268 | 278 | ?> |
| 269 | - <div class="cell medium-6 grid-x" id="attachments_position" <?php echo $style; ?>> | |
| 279 | + <div class="cell medium-6 grid-x" id="attachments_position" <?php echo $this->config->get('embed_files', 0) ? 'style="display:none;"' : ''; ?>> | |
| 270 | 280 | <div class="cell large-6"> |
| 271 | - <?php echo acym_translation('ACYM_CONFIGURATION_ATTACHMENTS_POSITION').acym_info(['textShownInTooltip' => 'ACYM_CONFIGURATION_ATTACHMENTS_POSITION_DESC']); ?> | |
| 281 | + <?php | |
| 282 | + echo esc_html(acym_translation('ACYM_CONFIGURATION_ATTACHMENTS_POSITION')); | |
| 283 | + acym_info( | |
| 284 | + ['textShownInTooltip' => 'ACYM_CONFIGURATION_ATTACHMENTS_POSITION_DESC'] | |
| 285 | + ); | |
| 286 | + ?> | |
| 272 | 287 | </div> |
| 273 | 288 | <div class="cell large-6"> |
| 274 | 289 | <?php |
| 275 | - echo acym_select( | |
| 290 | + acym_select( | |
| 276 | 291 | [ |
| 277 | 292 | 'top' => acym_translation('ACYM_TOP_OF_EMAIL_CONTENT'), |
| 278 | 293 | 'bottom' => acym_translation('ACYM_BOTTOM_OF_EMAIL_CONTENT'), |
| 279 | 294 | ], |
| @@ -278,9 +293,14 @@ | ||
| 278 | 293 | 'bottom' => acym_translation('ACYM_BOTTOM_OF_EMAIL_CONTENT'), |
| 279 | 294 | ], |
| 280 | 295 | 'config[attachments_position]', |
| 281 | 296 | $this->config->get('attachments_position', 'bottom'), |
| 282 | - ['class' => 'acym__select'] | |
| 297 | + ['class' => 'acym__select'], | |
| 298 | + 'value', | |
| 299 | + 'text', | |
| 300 | + null, | |
| 301 | + false, | |
| 302 | + true | |
| 283 | 303 | ); |
| 284 | 304 | ?> |
| 285 | 305 | </div> |
| 286 | 306 | </div> |
| @@ -286,39 +306,39 @@ | ||
| 286 | 306 | </div> |
| 287 | 307 | <div class="cell medium-6 grid-x"> |
| 288 | 308 | <label class="cell grid-x"> |
| 289 | 309 | <span class="cell medium-6"> |
| 290 | - <?php echo acym_translation('ACYM_MAIL_MAX_LINE_LENGTH').acym_info(['textShownInTooltip' => 'ACYM_MAIL_MAX_LINE_LENGTH_DESC']); ?> | |
| 310 | + <?php echo esc_html(acym_translation('ACYM_MAIL_MAX_LINE_LENGTH')); | |
| 311 | + acym_info(['textShownInTooltip' => 'ACYM_MAIL_MAX_LINE_LENGTH_DESC']); ?> | |
| 291 | 312 | </span> |
| 292 | 313 | <input type="number" |
| 293 | - name="config[mailer_wordwrap]" | |
| 294 | - value="<?php echo acym_escape($this->config->get('mailer_wordwrap', 0)); ?>" | |
| 295 | - min="0" | |
| 296 | - max="998" | |
| 297 | - class="cell medium-auto" /> | |
| 314 | + name="config[mailer_wordwrap]" | |
| 315 | + value="<?php echo esc_attr($this->config->get('mailer_wordwrap', 0)); ?>" | |
| 316 | + min="0" | |
| 317 | + max="998" | |
| 318 | + class="cell medium-auto" /> | |
| 298 | 319 | </label> |
| 299 | 320 | </div> |
| 300 | 321 | <div class="cell medium-6 grid-x"> |
| 301 | - <?php echo acym_switch( | |
| 302 | - 'config[dkim]', | |
| 303 | - $this->config->get('dkim'), | |
| 304 | - acym_translation('ACYM_CONFIGURATION_DKIM').acym_info(['textShownInTooltip' => 'ACYM_INTRO_DKIM']), | |
| 305 | - [], | |
| 306 | - 'medium-6 small-9', | |
| 307 | - 'auto', | |
| 308 | - '', | |
| 309 | - 'dkim_config' | |
| 310 | - ); ?> | |
| 322 | + <?php | |
| 323 | + acym_switch([ | |
| 324 | + 'name' => 'config[dkim]', | |
| 325 | + 'value' => $this->config->get('dkim'), | |
| 326 | + 'label' => acym_translation('ACYM_CONFIGURATION_DKIM'), | |
| 327 | + 'tip' => ['textShownInTooltip' => 'ACYM_INTRO_DKIM'], | |
| 328 | + 'toggle' => 'dkim_config', | |
| 329 | + ]); ?> | |
| 311 | 330 | </div> |
| 312 | 331 | </div> |
| 313 | 332 | |
| 314 | 333 | |
| 315 | 334 | <div class="cell acym__configuration__dkim padding-vertical-1 margin-y" id="dkim_config"> |
| 316 | - <div class="acym__title acym__title__secondary"><?php echo acym_translation('ACYM_DKIM_SETTINGS'); ?></div> | |
| 335 | + <div class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_DKIM_SETTINGS')); ?></div> | |
| 317 | 336 | <?php |
| 318 | 337 | $domain = $this->config->get('dkim_domain', ''); |
| 319 | 338 | if (empty($domain)) { |
| 320 | 339 | $domain = preg_replace(['#^https?://(www\.)*#i', '#^www\.#'], '', ACYM_LIVE); |
| 340 | + //we load the first part of the domain, until we get a / (yes, there is always a / at the end as the ACYM_LIVE adds one) | |
| 321 | 341 | $domain = substr($domain, 0, strpos($domain, '/')); |
| 322 | 342 | } |
| 323 | 343 | |
| 324 | 344 | $dkimSelector = $this->config->get('dkim_selector', 'acy'); |
| @@ -326,75 +346,87 @@ | ||
| 326 | 346 | ?> |
| 327 | 347 | <div class="grid-x grid-margin-x"> |
| 328 | 348 | <div class="cell large-6 grid-x grid-margin-x margin-y"> |
| 329 | 349 | <label for="dkim_domain_name" class="cell large-2 medium-3"> |
| 330 | - <?php echo acym_translation('ACYM_DKIM_DOMAIN'); ?> | |
| 350 | + <?php echo esc_html(acym_translation('ACYM_DKIM_DOMAIN')); ?> | |
| 331 | 351 | </label> |
| 332 | 352 | <div class="cell large-10 medium-9"> |
| 333 | - <input id="dkim_domain_name" type="text" name="config[dkim_domain]" value="<?php echo acym_escape($domain); ?>"> | |
| 353 | + <input id="dkim_domain_name" type="text" name="config[dkim_domain]" value="<?php echo esc_attr($domain); ?>"> | |
| 334 | 354 | </div> |
| 335 | 355 | |
| 336 | 356 | <label for="dkim_selector" class="cell large-2 medium-3"> |
| 337 | - <?php echo acym_translation('ACYM_DKIM_SELECTOR'); ?> | |
| 357 | + <?php echo esc_html(acym_translation('ACYM_DKIM_SELECTOR')); ?> | |
| 338 | 358 | </label> |
| 339 | 359 | <div class="cell large-10 medium-9"> |
| 340 | - <input id="dkim_selector" type="text" name="config[dkim_selector]" value="<?php echo acym_escape($this->config->get('dkim_selector', 'acy')); ?>"> | |
| 360 | + <input id="dkim_selector" type="text" name="config[dkim_selector]" value="<?php echo esc_attr($this->config->get('dkim_selector', 'acy')); ?>"> | |
| 341 | 361 | </div> |
| 342 | 362 | |
| 343 | 363 | <label for="dkim_private" class="cell large-2 medium-3"> |
| 344 | - <?php echo acym_translation('ACYM_DKIM_PRIVATE'); ?> | |
| 364 | + <?php echo esc_html(acym_translation('ACYM_DKIM_PRIVATE')); ?> | |
| 345 | 365 | </label> |
| 346 | 366 | <div class="cell large-10 medium-9"> |
| 347 | - <textarea id="dkim_private" name="config[dkim_private]"><?php echo $this->config->get('dkim_private', ''); ?></textarea> | |
| 367 | + <textarea id="dkim_private" name="config[dkim_private]"><?php echo esc_html($this->config->get('dkim_private', '')); ?></textarea> | |
| 348 | 368 | </div> |
| 349 | 369 | </div> |
| 350 | 370 | |
| 351 | 371 | <div class="cell large-6 grid-x grid-margin-x margin-y"> |
| 352 | 372 | <label for="dkim_passphrase" class="cell large-2 medium-3"> |
| 353 | - <?php echo acym_translation('ACYM_DKIM_PASSPHRASE'); ?> | |
| 373 | + <?php echo esc_html(acym_translation('ACYM_DKIM_PASSPHRASE')); ?> | |
| 354 | 374 | </label> |
| 355 | 375 | <div class="cell large-10 medium-9"> |
| 356 | 376 | <input id="dkim_passphrase" |
| 357 | - type="text" | |
| 358 | - name="config[dkim_passphrase]" | |
| 359 | - value="<?php echo acym_escape($this->config->get('dkim_passphrase', '')); ?>"> | |
| 377 | + type="text" | |
| 378 | + name="config[dkim_passphrase]" | |
| 379 | + value="<?php echo esc_attr($this->config->get('dkim_passphrase', '')); ?>"> | |
| 360 | 380 | </div> |
| 361 | 381 | |
| 362 | 382 | <label for="dkim_identity" class="cell large-2 medium-3"> |
| 363 | - <?php echo acym_translation('ACYM_DKIM_IDENTITY'); ?> | |
| 383 | + <?php echo esc_html(acym_translation('ACYM_DKIM_IDENTITY')); ?> | |
| 364 | 384 | </label> |
| 365 | 385 | <div class="cell large-10 medium-9"> |
| 366 | - <input id="dkim_identity" type="text" name="config[dkim_identity]" value="<?php echo acym_escape($this->config->get('dkim_identity', '')); ?>"> | |
| 386 | + <input id="dkim_identity" type="text" name="config[dkim_identity]" value="<?php echo esc_attr($this->config->get('dkim_identity', '')); ?>"> | |
| 367 | 387 | </div> |
| 368 | 388 | |
| 369 | 389 | <label for="dkim_public" class="cell large-2 medium-3"> |
| 370 | - <?php echo acym_translation('ACYM_DKIM_PUBLIC'); ?> | |
| 390 | + <?php echo esc_html(acym_translation('ACYM_DKIM_PUBLIC')); ?> | |
| 371 | 391 | </label> |
| 372 | 392 | <div class="cell large-10 medium-9"> |
| 373 | - <textarea id="dkim_public" name="config[dkim_public]"><?php echo $this->config->get('dkim_public', ''); ?></textarea> | |
| 393 | + <textarea id="dkim_public" name="config[dkim_public]"><?php echo esc_html($this->config->get('dkim_public', '')); ?></textarea> | |
| 374 | 394 | </div> |
| 375 | 395 | </div> |
| 376 | 396 | </div> |
| 377 | 397 | <?php |
| 378 | 398 | } else { |
| 399 | + //Be compatible with what we used to have: | |
| 379 | 400 | $publicKey = 'v=DKIM1;s=email;t=s;p='.trim($this->config->get('dkim_public', ''), '"'); |
| 380 | 401 | |
| 381 | - echo acym_translationSprintf( | |
| 382 | - 'ACYM_DKIM_CONFIGURE', | |
| 383 | - '<input class="margin-bottom-0" type="text" id="dkim_domain" name="config[dkim_domain]" value="'.acym_escape($domain).'" />' | |
| 402 | + echo wp_kses( | |
| 403 | + acym_translationSprintf( | |
| 404 | + 'ACYM_DKIM_CONFIGURE', | |
| 405 | + '<input class="margin-bottom-0" type="text" id="dkim_domain" name="config[dkim_domain]" value="'.esc_attr($domain).'" />' | |
| 406 | + ), | |
| 407 | + [ | |
| 408 | + 'input' => [ | |
| 409 | + 'class' => true, | |
| 410 | + 'type' => true, | |
| 411 | + 'id' => true, | |
| 412 | + 'name' => true, | |
| 413 | + 'value' => true, | |
| 414 | + ], | |
| 415 | + ] | |
| 384 | 416 | ); |
| 385 | 417 | ?> |
| 386 | 418 | <div class="cell"> |
| 387 | - <?php echo acym_translation('ACYM_DKIM_KEY'); ?> | |
| 419 | + <?php echo esc_html(acym_translation('ACYM_DKIM_KEY')); ?> | |
| 388 | 420 | <input id="dkim_key" class="acym_autoselect margin-bottom-0" type="text" readonly="readonly" value="acy._domainkey" /> |
| 389 | 421 | </div> |
| 390 | 422 | <div class="cell"> |
| 391 | - <?php echo acym_translation('ACYM_DKIM_VALUE'); ?> | |
| 392 | - <input id="dkim_value" class="acym_autoselect margin-bottom-0" type="text" readonly="readonly" value="<?php echo acym_escape($publicKey); ?>" /> | |
| 423 | + <?php echo esc_html(acym_translation('ACYM_DKIM_VALUE')); ?> | |
| 424 | + <input id="dkim_value" class="acym_autoselect margin-bottom-0" type="text" readonly="readonly" value="<?php echo esc_attr($publicKey); ?>" /> | |
| 393 | 425 | </div> |
| 394 | 426 | <div class="cell"> |
| 395 | 427 | <input type="checkbox" value="1" id="dkimletme" name="dkimletme" /> |
| 396 | - <label for="dkimletme"><?php echo acym_translation('ACYM_DKIM_LET_ME'); ?></label> | |
| 428 | + <label for="dkimletme"><?php echo esc_html(acym_translation('ACYM_DKIM_LET_ME')); ?></label> | |
| 397 | 429 | </div> |
| 398 | 430 | <?php |
| 399 | 431 | } |
| 400 | 432 | ?> |
| @@ -399,12 +431,13 @@ | ||
| 399 | 431 | } |
| 400 | 432 | ?> |
| 401 | 433 | |
| 402 | 434 | <div class="cell"> |
| 403 | - <a class="button button-secondary margin-bottom-0 margin-top-1" target="_blank" href="<?php echo ACYM_DOCUMENTATION; ?>setup/configuration/mail-configuration/dkim"> | |
| 404 | - <?php echo acym_translation('ACYM_HELP'); ?> | |
| 435 | + <a class="button button-secondary margin-bottom-0 margin-top-1" | |
| 436 | + target="_blank" | |
| 437 | + href="<?php echo esc_url(ACYM_DOCUMENTATION); ?>setup/configuration/mail-configuration/dkim"> | |
| 438 | + <?php echo esc_html(acym_translation('ACYM_HELP')); ?> | |
| 405 | 439 | </a> |
| 406 | 440 | </div> |
| 407 | 441 | </div> |
| 408 | 442 | </div> |
| 409 | - | |
| 410 | 443 | </div> |