diff --git src/wp-includes/pluggable.php src/wp-includes/pluggable.php
index 5b441d8..0025c59 100644
|
|
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() |
245 | 245 | */ |
246 | 246 | $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); |
247 | 247 | |
| 248 | if ( ! is_array( $atts ) ) { |
| 249 | return $atts; |
| 250 | } |
| 251 | |
248 | 252 | if ( isset( $atts['to'] ) ) { |
249 | 253 | $to = $atts['to']; |
250 | 254 | } |
diff --git tests/phpunit/tests/mail.php tests/phpunit/tests/mail.php
index 229ff23..bb5e438 100644
|
|
class Tests_Mail extends WP_UnitTestCase { |
288 | 288 | |
289 | 289 | $this->assertNotContains( 'quoted-printable', $GLOBALS['phpmailer']->mock_sent[0]['header'] ); |
290 | 290 | } |
| 291 | |
| 292 | /** |
| 293 | * @ticket 35069 |
| 294 | */ |
| 295 | public function test_wp_mail_bail_early() { |
| 296 | $this->assertTrue( wp_mail( WP_TESTS_EMAIL, 'Foo', 'Bar' ) ); |
| 297 | |
| 298 | add_filter( 'wp_mail', '__return_false' ); |
| 299 | $this->assertFalse( wp_mail( WP_TESTS_EMAIL, 'Foo', 'Bar' ) ); |
| 300 | remove_filter( 'wp_mail', '__return_false' ); |
| 301 | |
| 302 | add_filter( 'wp_mail', '__return_empty_string' ); |
| 303 | $this->assertSame( '', wp_mail( WP_TESTS_EMAIL, 'Foo', 'Bar' ) ); |
| 304 | remove_filter( 'wp_mail', '__return_empty_string' ); |
| 305 | } |
291 | 306 | } |