| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | |
| 16 | 16 | // Security check. |
| 17 | 17 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 18 | 18 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-mail-settings-' . WPDA::get_current_user_login() ) ) { |
| 19 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 19 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | if ( 'save' === $action ) { |
| 23 | 23 | |
| @@ -22,16 +22,16 @@ | ||
| 22 | 22 | if ( 'save' === $action ) { |
| 23 | 23 | |
| 24 | 24 | $mail = array( |
| 25 | 25 | 'activate' => isset( $_POST['activate'] ) ? sanitize_text_field( wp_unslash( $_POST['activate'] ) ) : '', |
| 26 | - 'host' => sanitize_text_field( wp_unslash( $_POST['host'] ) ), | |
| 27 | - 'port' => sanitize_text_field( wp_unslash( $_POST['port'] ) ), | |
| 26 | + 'host' => sanitize_text_field( wp_unslash( $_POST['host'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 27 | + 'port' => sanitize_text_field( wp_unslash( $_POST['port'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 28 | 28 | 'authenticate' => isset( $_POST['authenticate'] ) ? sanitize_text_field( wp_unslash( $_POST['authenticate'] ) ) : '', |
| 29 | - 'encryption' => sanitize_text_field( wp_unslash( $_POST['encryption'] ) ), | |
| 29 | + 'encryption' => sanitize_text_field( wp_unslash( $_POST['encryption'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 30 | 30 | 'skip_verify' => isset( $_POST['skip_verify'] ) ? sanitize_text_field( wp_unslash( $_POST['skip_verify'] ) ) : '', |
| 31 | - 'username' => sanitize_text_field( wp_unslash( $_POST['username'] ) ), | |
| 32 | - 'password' => sanitize_text_field( wp_unslash( $_POST['password'] ) ), | |
| 33 | - 'debug' => sanitize_text_field( wp_unslash( $_POST['debug'] ) ), | |
| 31 | + 'username' => sanitize_text_field( wp_unslash( $_POST['username'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 32 | + 'password' => sanitize_text_field( wp_unslash( $_POST['password'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 33 | + 'debug' => sanitize_text_field( wp_unslash( $_POST['debug'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated | |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | 36 | WPDA_Mail::update_option( $mail ); |
| 37 | 37 | |
| @@ -76,9 +76,9 @@ | ||
| 76 | 76 | <input |
| 77 | 77 | type="checkbox" |
| 78 | 78 | name="activate" |
| 79 | 79 | <?php echo 'on' === $activate ? 'checked' : ''; ?> |
| 80 | - /> <?php echo __( 'Activate', 'wp-data-access' ); ?> | |
| 80 | + /> <?php esc_html_e( 'Activate', 'wp-data-access' ); ?> | |
| 81 | 81 | </label> |
| 82 | 82 | </th> |
| 83 | 83 | <td> |
| 84 | 84 | SMTP mail server settings are used to send scheduled SQL Query Builder results. |
| @@ -230,18 +230,18 @@ | ||
| 230 | 230 | <div class="wpda-table-settings-button"> |
| 231 | 231 | <input type="hidden" name="action" value="save"/> |
| 232 | 232 | <button type="submit" class="button button-primary"> |
| 233 | 233 | <i class="fas fa-check wpda_icon_on_button"></i> |
| 234 | - <?php echo __( 'Save Mail Settings', 'wp-data-access' ); ?> | |
| 234 | + <?php esc_html_e( 'Save Mail Settings', 'wp-data-access' ); ?> | |
| 235 | 235 | </button> |
| 236 | 236 | <a href="javascript:void(0)" |
| 237 | - onclick="if (confirm('<?php echo __( 'Reset to defaults?', 'wp-data-access' ); ?>')) { | |
| 237 | + onclick="if (confirm('<?php esc_html_e( 'Reset to defaults?', 'wp-data-access' ); ?>')) { | |
| 238 | 238 | jQuery('input[name=\'action\']').val('setdefaults'); |
| 239 | 239 | jQuery('#wpda_settings_mail').trigger('submit'); |
| 240 | 240 | }" |
| 241 | 241 | class="button button-secondary"> |
| 242 | 242 | <i class="fas fa-times-circle wpda_icon_on_button"></i> |
| 243 | - <?php echo __( 'Reset Mail Settings To Defaults', 'wp-data-access' ); ?> | |
| 243 | + <?php esc_html_e( 'Reset Mail Settings To Defaults', 'wp-data-access' ); ?> | |
| 244 | 244 | </a> |
| 245 | 245 | </div> |
| 246 | 246 | |
| 247 | 247 | <?php wp_nonce_field( 'wpda-mail-settings-' . WPDA::get_current_user_login(), '_wpnonce', false ); ?> |