Skip to content

Commit b0a29f3

Browse files
committed
Deploying version 1.6.5
1 parent e5f7a4b commit b0a29f3

File tree

10 files changed

+108
-62
lines changed

10 files changed

+108
-62
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**Requires at least:** 5.3 \
66
**Tested up to:** 6.2 \
77
**Requires PHP:** 7.2 \
8-
**Stable tag:** 1.6.4
8+
**Stable tag:** 1.6.5
99

1010
Fix your email delivery problems by sending your WordPress emails through Amazon SES's powerful email sending infrastructure.
1111

@@ -191,6 +191,11 @@ Please double check the credentials match up with the credentials you received w
191191

192192
## Changelog
193193

194+
### 1.6.5 - 2023-06-05
195+
196+
* Bug fix: Apostrophes in email addresses no longer prevent sending
197+
* Bug fix: More than 25 Verified Senders can now be managed
198+
194199
### 1.6.4 - 2023-05-18
195200

196201
* Bug fix: WP Offload SES now works with PHP 8.2

classes/Activity-List-Table.php

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ public function column_default( $item, $column_name ) {
118118
* @param array $email The array of info about the email.
119119
*/
120120
public function column_cb( $email ) {
121-
$id = esc_attr( $email['id'] );
121+
$id = esc_attr( $email['id'] );
122122
?>
123-
<input id="cb-select-<?php echo $id; ?>" type="checkbox" name="email[]" value="<?php echo $id; ?>" />
123+
<input id="cb-select-<?php echo $id; ?>" type="checkbox" name="email[]" value="<?php echo $id; ?>"/>
124124
<?php
125125
}
126126

@@ -313,9 +313,7 @@ public function get_data( $current_page, $per_page ) {
313313
ORDER BY $orderby $order
314314
LIMIT $offset, $count";
315315

316-
$results = $this->database->get_results( $query, ARRAY_A );
317-
318-
return $results;
316+
return stripslashes_deep( $this->database->get_results( $query, ARRAY_A ) );
319317
}
320318

321319
/**
@@ -409,9 +407,10 @@ public function render_views() {
409407
* The dynamic portion of the hook name, `$this->screen->id`, refers
410408
* to the ID of the current screen, usually a string.
411409
*
410+
* @param string[] $views An array of available list table views.
411+
*
412412
* @since 3.5.0
413413
*
414-
* @param string[] $views An array of available list table views.
415414
*/
416415
$views = apply_filters( "views_{$this->screen->id}", $views );
417416
if ( empty( $views ) ) {
@@ -427,7 +426,7 @@ public function render_views() {
427426
$current = 'all';
428427
}
429428

430-
$current = ( $current === $class ) ? 'current' : '';
429+
$current = ( $current === $class ) ? 'current' : '';
431430
$views[ $class ] = "\t<li class='$class'><a href='#activity' class='$current' data-status='$class'>$view</a>";
432431
}
433432
echo implode( " |</li>\n", $views ) . "</li>\n";
@@ -508,17 +507,17 @@ public function process_bulk_actions() {
508507
public function display() {
509508
?>
510509
<form id="wposes-activity-form" method="post">
511-
<?php
512-
wp_nonce_field( 'wposes-activity-nonce', 'wposes_activity_nonce' );
510+
<?php
511+
wp_nonce_field( 'wposes-activity-nonce', 'wposes_activity_nonce' );
513512

514-
$order = ! empty( $this->_pagination_args['order'] ) ? $this->_pagination_args['order'] : 'desc';
515-
$orderby = ! empty( $this->_pagination_args['orderby'] ) ? $this->_pagination_args['orderby'] : 'date';
513+
$order = ! empty( $this->_pagination_args['order'] ) ? $this->_pagination_args['order'] : 'desc';
514+
$orderby = ! empty( $this->_pagination_args['orderby'] ) ? $this->_pagination_args['orderby'] : 'date';
516515

517-
echo '<input type="hidden" id="order" name="order" value="' . esc_attr( $order ) . '" />';
518-
echo '<input type="hidden" id="orderby" name="orderby" value="' . esc_attr( $orderby ) . '" />';
516+
echo '<input type="hidden" id="order" name="order" value="' . esc_attr( $order ) . '" />';
517+
echo '<input type="hidden" id="orderby" name="orderby" value="' . esc_attr( $orderby ) . '" />';
519518

520-
parent::display();
521-
?>
519+
parent::display();
520+
?>
522521
</form>
523522
<?php
524523
}
@@ -548,9 +547,9 @@ public function extra_tablenav( $which = 'top' ) {
548547
?>
549548
<div id="wposes-activity-actions" class="alignleft actions">
550549
<?php $this->email_months_dropdown(); ?>
551-
<input id="wposes-subject-search" type="text" name="subject" placeholder="<?php _e( 'All Subjects', 'wp-offload-ses' ); ?>" />
552-
<input id="wposes-recipient-search" type="text" name="recipient" placeholder="<?php _e( 'All Recipients', 'wp-offload-ses' ); ?>" />
553-
<input type="submit" id="wposes-filter-btn" name="filter_action" class="button action" value="<?php _e( 'Filter', 'wp-offload-ses' ); ?>" />
550+
<input id="wposes-subject-search" type="text" name="subject" placeholder="<?php _e( 'All Subjects', 'wp-offload-ses' ); ?>"/>
551+
<input id="wposes-recipient-search" type="text" name="recipient" placeholder="<?php _e( 'All Recipients', 'wp-offload-ses' ); ?>"/>
552+
<input type="submit" id="wposes-filter-btn" name="filter_action" class="button action" value="<?php _e( 'Filter', 'wp-offload-ses' ); ?>"/>
554553
</div>
555554
<?php
556555
}
@@ -566,7 +565,7 @@ public function email_months_dropdown() {
566565
FROM {$this->emails_table}
567566
ORDER BY email_created DESC"
568567
);
569-
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
568+
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
570569
?>
571570
<select name="m" id="wposes-filter-by-date">
572571
<option <?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates', 'wp-offload-ses' ); ?></option>
@@ -587,8 +586,8 @@ public function email_months_dropdown() {
587586
);
588587
}
589588
?>
590-
</select>
591-
<?php
589+
</select>
590+
<?php
592591
}
593592

594593
/**

classes/Email.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ private function maybe_log_unverified_sender( string $email ) {
167167
*/
168168
private function to( $to ) {
169169
$to = $this->maybe_convert_to_array( $to );
170+
$to = stripslashes_deep( $to );
170171

171172
foreach ( $to as $recipient ) {
172173
try {
@@ -217,7 +218,7 @@ private function from() {
217218
* @param string $subject The subject of the email.
218219
*/
219220
private function subject( $subject ) {
220-
$this->mail->Subject = $subject;
221+
$this->mail->Subject = stripslashes( $subject );
221222
}
222223

223224
/**
@@ -323,6 +324,7 @@ private function header_content_type( $content ) {
323324
private function header_cc( $content, $type = 'cc' ) {
324325
// They could be in CSV format.
325326
$ccs = explode( ',', $content );
327+
$ccs = stripslashes_deep( $ccs );
326328

327329
if ( empty( $ccs ) ) {
328330
return;
@@ -353,6 +355,7 @@ private function header_cc( $content, $type = 'cc' ) {
353355
*/
354356
private function header_reply_to( $content ) {
355357
$reply_to = $this->maybe_convert_to_array( $content );
358+
$reply_to = stripslashes_deep( $reply_to );
356359

357360
foreach ( $reply_to as $recipient ) {
358361
try {
@@ -480,6 +483,11 @@ public function prepare() {
480483
$this->mail->Body = $wp_offload_ses->get_email_events()->filter_email_content( $this->email_id, $this->mail->Body );
481484
}
482485

486+
// May need to strip slashes in the body.
487+
if ( 'text/html' !== $this->mail->ContentType ) {
488+
$this->mail->Body = stripslashes( $this->mail->Body );
489+
}
490+
483491
// Fires after PHPMailer is initialized.
484492
do_action_ref_array( 'phpmailer_init', array( &$this->mail ) );
485493

@@ -576,9 +584,9 @@ public function view( $email_data = array() ) {
576584

577585
$body = $this->sanitize_email_body( $this->mail->Body );
578586

579-
// Maybe add HTML line breaks.
587+
// Maybe strip slashes and add HTML line breaks.
580588
if ( 'text/html' !== $this->mail->ContentType ) {
581-
$body = nl2br( $body );
589+
$body = nl2br( stripslashes( $body ) );
582590
}
583591

584592
if ( isset( $email_data['status_i18n'] ) ) {

classes/SES-API.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,18 @@ public function get_send_quota() {
150150
/**
151151
* Get the identities associated with the account.
152152
*
153-
* @param array $args Args to pass to the request.
153+
* @param array $args Args to pass to the request.
154+
* @param array $prev_identities Previously returned identities if paging.
154155
*
155156
* @return array|Error
156157
*/
157-
public function get_identities( array $args = array() ) {
158+
public function get_identities( array $args = array(), array $prev_identities = array() ) {
159+
if ( empty( $args['PageSize'] ) ) {
160+
$args['PageSize'] = 1000;
161+
}
162+
163+
$prev_identities = empty( $prev_identities ) ? array() : $prev_identities;
164+
158165
try {
159166
$response = $this->get_client()->listEmailIdentities( $args );
160167
$identities = $response['EmailIdentities'];
@@ -183,6 +190,14 @@ public function get_identities( array $args = array() ) {
183190
}
184191
}
185192

193+
$identities = array_merge( $prev_identities, $identities );
194+
195+
if ( ! empty( $response['NextToken'] ) ) {
196+
$args['NextToken'] = $response['NextToken'];
197+
198+
return $this->get_identities( $args, $identities );
199+
}
200+
186201
return $identities;
187202
}
188203

classes/Settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public function get_setting( string $key, $default = '' ) {
381381
$this->get_settings();
382382
$setting = $this->settings[ $key ] ?? $default;
383383

384-
return apply_filters( 'wposes_get_setting', $setting, $key );
384+
return stripslashes_deep( apply_filters( 'wposes_get_setting', $setting, $key ) );
385385
}
386386

387387
/**
@@ -396,7 +396,7 @@ public function get_network_setting( string $key, $default = '' ) {
396396
$this->get_network_settings();
397397
$network_setting = $this->network_settings[ $key ] ?? $default;
398398

399-
return apply_filters( 'wposes_get_network_setting', $network_setting, $key );
399+
return stripslashes_deep( apply_filters( 'wposes_get_network_setting', $network_setting, $key ) );
400400
}
401401

402402
/**

0 commit comments

Comments
 (0)