WordPress.org

Make WordPress Core

Ticket #35069: 35069.diff

File 35069.diff, 479 bytes (added by DvanKooten, 6 years ago)

Check if return value of filter is falsey and return early if so.

  • src/wp-includes/pluggable.php

     
    245245         */
    246246        $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
    247247
     248        // A plugin disallowed this email
     249        if( empty( $atts ) ) {
     250                return false;
     251        }
     252
    248253        if ( isset( $atts['to'] ) ) {
    249254                $to = $atts['to'];
    250255        }