Skip to content

Commit

Permalink
Version change
Browse files Browse the repository at this point in the history
$to parameter being erased by extract()

Fixed issues with possible overriding $to param
  • Loading branch information
oleksandr-mykhailenko committed Dec 11, 2022
1 parent 915109d commit 8ed115b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changelog
=========
1.8.8 (2022-12-11)
- Fixed bug when `$to` override in the `wp_mail` function

1.8.7 (2022-11-12)
- Fixed bug when field `Override "From" Details` was not updated

Expand Down
11 changes: 2 additions & 9 deletions includes/wp-mail-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ function mg_mutate_to_rcpt_vars_cb($to_addrs)
if (!function_exists('wp_mail')) {
function wp_mail($to, $subject, $message, $headers = '', $attachments = array())
{
// Compact the input, apply the filters, and extract them back out
$extractData = apply_filters('wp_mail', compact('to', 'subject', 'message', 'headers', 'attachments'));
if (!is_array($extractData)) {
$extractData = (array)$extractData;
}
extract($extractData, EXTR_OVERWRITE);

$mailgun = get_option('mailgun');
$region = (defined('MAILGUN_REGION') && MAILGUN_REGION) ? MAILGUN_REGION : $mailgun['region'];
$apiKey = (defined('MAILGUN_APIKEY') && MAILGUN_APIKEY) ? MAILGUN_APIKEY : $mailgun['apiKey'];
Expand All @@ -129,7 +122,7 @@ function wp_mail($to, $subject, $message, $headers = '', $attachments = array())
}

// If a region is not set via defines or through the options page, default to US region.
if (!((bool)$region)) {
if (!($region)) {
error_log('[Mailgun] No region configuration was found! Defaulting to US region.');
$region = 'us';
}
Expand Down Expand Up @@ -256,7 +249,7 @@ function wp_mail($to, $subject, $message, $headers = '', $attachments = array())
} elseif (is_array($body['o:tag'])) {
$body['o:tag'] = array_merge($body['o:tag'], $tags);
} else {
$body['o:tag'] .= ',' . $tags;
$body['o:tag'] .= ',' . implode(',', $tags);
}
}

Expand Down
4 changes: 2 additions & 2 deletions mailgun.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Plugin Name: Mailgun
* Plugin URI: http://wordpress.org/extend/plugins/mailgun/
* Description: Mailgun integration for WordPress
* Version: 1.8.7
* Version: 1.8.8
* Tested up to: 6.1
* Author: Mailgun
* Author URI: http://www.mailgun.com/
* License: GPLv2 or later
* License: GPLv2 or late
* Text Domain: mailgun
* Domain Path: /languages/.
*/
Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contributors: mailgun, sivel, lookahead.io, m35dev
Tags: mailgun, smtp, http, api, mail, email
Requires at least: 3.3
Tested up to: 6.1
Stable tag: 1.8.7
Stable tag: 1.8.8
Requires PHP: 5.6
License: GPLv2 or later

Expand Down Expand Up @@ -130,6 +130,9 @@ MAILGUN_FROM_ADDRESS Type: string


== Changelog ==
= 1.8.8 (2022-12-11): =
- Fixed bug when `$to` override in the `wp_mail` function

= 1.8.7 (2022-11-12): =
- Fixed bug when field `Override "From" Details` was not updated

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contributors: mailgun, sivel, lookahead.io, m35dev
Tags: mailgun, smtp, http, api, mail, email
Requires at least: 4.4
Tested up to: 6.1
Stable tag: 1.8.7
Stable tag: 1.8.8
Requires PHP: 5.6
License: GPLv2 or later

Expand Down

0 comments on commit 8ed115b

Please sign in to comment.