| @@ -5,8 +5,9 @@ | ||
| 5 | 5 | class plgAcymAmazon extends AcymPlugin |
| 6 | 6 | { |
| 7 | 7 | const SENDING_METHOD_ID = 'amazon'; |
| 8 | 8 | const SENDING_METHOD_NAME = 'Amazon SES'; |
| 9 | + // phpcs:ignore PluginCheck.CodeAnalysis.Offloading.OffloadedContent -- False alarm. | |
| 9 | 10 | const SENDING_METHOD_HOST = 'email-smtp.us-east-2.amazonaws.com'; |
| 10 | 11 | |
| 11 | 12 | public function __construct() |
| 12 | 13 | { |
| @@ -24,17 +25,16 @@ | ||
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | public function onAcymGetSendingMethodsHtmlSetting(&$data) |
| 27 | 28 | { |
| 28 | - ob_start(); | |
| 29 | 29 | ?> |
| 30 | - <div class="send_settings cell grid-x acym_vcenter" id="<?php echo self::SENDING_METHOD_ID; ?>_settings"> | |
| 30 | + <div class="send_settings cell grid-x acym_vcenter" id="<?php echo esc_attr(self::SENDING_METHOD_ID); ?>_settings"> | |
| 31 | 31 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 32 | 32 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 33 | 33 | <label for="amazon_host" class="cell shrink"> |
| 34 | 34 | <?php |
| 35 | - echo acym_translation('ACYM_AMAZON_SES_SERVER'); | |
| 36 | - echo acym_info( | |
| 35 | + echo esc_html(acym_translation('ACYM_AMAZON_SES_SERVER')); | |
| 36 | + acym_info( | |
| 37 | 37 | [ |
| 38 | 38 | 'textShownInTooltip' => acym_translation('ACYM_AMAZON_SES_SERVER_DESC'), |
| 39 | 39 | ] |
| 40 | 40 | ); |
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | ] |
| 40 | 40 | ); |
| 41 | 41 | ?> |
| 42 | 42 | </label> |
| 43 | - <?php echo $this->getLinks( | |
| 43 | + <?php $this->getLinks( | |
| 44 | 44 | 'https://signin.aws.amazon.com/signin?redirect_uri=https%3A%2F%2Fportal.aws.amazon.com%2Fbilling%2Fsignup%2Fresume&client_id=signup', |
| 45 | 45 | 'https://aws.amazon.com/en/ses/pricing/' |
| 46 | 46 | ); ?> |
| 47 | 47 | <input id="amazon_host" |
| @@ -47,32 +47,38 @@ | ||
| 47 | 47 | <input id="amazon_host" |
| 48 | 48 | class="cell" |
| 49 | 49 | type="text" |
| 50 | 50 | name="config[amazon_host]" |
| 51 | - value="<?php echo acym_escape($this->config->get('amazon_host', self::SENDING_METHOD_HOST)); ?>"> | |
| 51 | + value="<?php echo esc_attr($this->config->get('amazon_host', self::SENDING_METHOD_HOST)); ?>"> | |
| 52 | 52 | </div> |
| 53 | 53 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 54 | - <label for="amazon_username" class="cell"><?php echo acym_translation('ACYM_AMAZON_SES_USERNAME'); ?></label> | |
| 54 | + <label for="amazon_username" class="cell"><?php echo esc_html(acym_translation('ACYM_AMAZON_SES_USERNAME')); ?></label> | |
| 55 | 55 | <input id="amazon_username" |
| 56 | 56 | class="cell" |
| 57 | 57 | type="text" |
| 58 | 58 | name="config[amazon_username]" |
| 59 | - value="<?php echo acym_escape($this->config->get('amazon_username')); ?>"> | |
| 59 | + value="<?php echo esc_attr($this->config->get('amazon_username')); ?>"> | |
| 60 | 60 | </div> |
| 61 | 61 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 62 | - <label for="amazon_password" class="cell"><?php echo acym_translation('ACYM_AMAZON_SES_PASSWORD'); ?></label> | |
| 62 | + <label for="amazon_password" class="cell"><?php echo esc_html(acym_translation('ACYM_AMAZON_SES_PASSWORD')); ?></label> | |
| 63 | 63 | <input id="amazon_password" |
| 64 | 64 | class="cell" |
| 65 | 65 | type="text" |
| 66 | 66 | name="config[amazon_password]" |
| 67 | - value="<?php echo str_repeat('*', strlen($this->config->get('amazon_password'))); ?>"> | |
| 67 | + value="<?php echo esc_attr(str_repeat('*', strlen($this->config->get('amazon_password')))); ?>"> | |
| 68 | 68 | </div> |
| 69 | 69 | </div> |
| 70 | 70 | </div> |
| 71 | 71 | <?php |
| 72 | - $data['sendingMethodsHtmlSettings'][self::SENDING_METHOD_ID] = ob_get_clean(); | |
| 73 | 72 | } |
| 74 | 73 | |
| 74 | + /** | |
| 75 | + * @param array $credentials | |
| 76 | + * @param string $sendingMethod | |
| 77 | + * @param array $sendingMethodListParams this parameter is only used for the plugin sending method list | |
| 78 | + * | |
| 79 | + * @return void | |
| 80 | + */ | |
| 75 | 81 | public function onAcymGetCredentialsSendingMethod(array &$credentials, string $sendingMethod, array $sendingMethodListParams = []) |
| 76 | 82 | { |
| 77 | 83 | if ($sendingMethod != self::SENDING_METHOD_ID) return; |
| 78 | 84 | |